Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Question for the Pros: DarkBasic graphic errors - problems with newer graphic cards? Please help!

Author
Message
Rylex
22
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 30th Oct 2013 19:37 Edited at: 30th Oct 2013 22:20
Hi everybody,

I've been working on a new project for the last months and I decided to use the old "DarkBasic" Classic and NOT DarkBasic Pro.

You could ask me why: well because of the crashing Windows Key (Alt+Tab) bug when making a fullscreen application. I don't want to use a windowed application and I don't want to use a maximized window. And I don't want to use "Fulldesktop" because this has other side effects with the screen ratio.
I know that I could try to handle the errors and reload the models with DarkBasic Pro but this does NOT work with matrices. When using a matrix and pressing Alt+Tab or Windows key, it's over!

And because I use matrix generation with this project => DarkBasic Pro is useless for me.

Okay anyway... DarkBasic Classic is a great product (and in my eyes even better than DarkBasic Pro) but I experienced a graphic problem and wanted to ask if anybody here could help me or has experienced the same problem?

What did I do:
I created one matrix for the landscape and one for water.
The water matrix is a ghost matrix. But a solid water matrix doesn't change anything... the problem occurs there, too.

I scroll the matrix down and everything works OK. Te landscape is generated and it works fine BUT the landscape itsself looks distorted on new systems. When seen from top view the problem looks like the following:

Intel Core i5 680 - Geforce 450GTS - Windows 7


...but it should look like this:

Intel Pentium 4 - 3.4 GHz - Geforce 8600GT - Windows 7


Another screenshot:

Intel Core i5 680 - Geforce 450GTS - Windows 7


Intel Pentium 4 - 3.4 GHz - Geforce 8600GT - Windows 7


I tested it with different driver versions for the Geforce 450GTS ... I enabled/disabled VSync and neary tried all other settings I could change. Nothing changed this effect. Normal I use VSync On and set Tripple Buffering on (it doesn't work with Double buffering, too!)...

Both systems above have been configured identical as far as the Geforce drivers let me allow to do so.

I have a friend who uses a Geforce 9800 graphics card and the program runs fine without the distorted landscape. On the other hand - an Atom Netbook with integrated graphics shows the same problem with distorted landscape
So I think it might have something to do with the new graphics cards? Is there any possibility to change this problem with DarkBasic Classic?

I use DarkBasic 1.13 English Version because I like this version more than 1.21 because of German keyboard support. 1.21 is buggy and only uses American keyboard even if my system says my keyboard is German.
Anyway... - it doesn't change anything with 1.21 - the newer version 1.21 has exactly the same problem with the distorted landscape.

If you would like to test it on your system - then you could try the following example:
http://www.rylex.de/download/test.zip

Extract the files to a folder and run the EXE-file.

If you run the file:
- Press "v" key for top view to take a look at the landscape like above pictures.
- Press "ESC" to exit the program.

If you don't want to run this example you can create two matrices and scroll them down and take a look at them from above.

The top view however is not the worst problem. I want to position some trees on the landscape and so far this works perfect with old graphics cards.
Using new graphic cards the trees are distorted, too - when they are far away. The closer they get the less distorted they are. I guess this is a problem with the Z-buffer.
So if the landscape is OK, then the trees are OK, too.

If anybody here could help or has an idea please let me know.

One more thing:
I have bought an original DarkBasic Classic German Version but I use the English 1.13 version because the German version is bugged, too. However this English version I have here doesn't have any INI-files inside the program directory.

Update:
I've created an INI-File with the settings from here:
http://forum.thegamecreators.com/?m=forum_view&t=177465&b=10
The setup.ini files itsself seems to work because DarkBasic can now run inside a Window.
I thougt it could be the setting:
Quote: "; 3doverlay : 0=normal / 1=Utilize ZBuffer Clear for overlapped 3D rendering"

But setting this to 1 didn't help with the problem of this thread. Well... I didn't restart the system I just restarted DarkBasic. All the other settings inside the setup.ini file didn't show an effect so far.

If you have experienced this problem, too and have an idea about this problem, then please help me.
Thank you very much!

Rylex
Mulderman
20
Years of Service
User Offline
Joined: 8th Jan 2004
Location: C:\\
Posted: 30th Oct 2013 23:30 Edited at: 30th Oct 2013 23:33
Hello.
Tested on my XP Pro SP3 with ATI Radeon 9550 (i know, very old) and the latest drivers available.
And landscape looks distorted for me also.

Maybe it has something to do with DirectX version?
Did you compared the versions on different machines?

I have:
DirectX Version: DirectX 9.0c (4.09.0000.0904)
Rylex
22
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 31st Oct 2013 10:09 Edited at: 31st Oct 2013 10:10
Hi Mulderman,

thank you very much for your answer. All my tested computers have the same DirectX Version 11.
On the Pentium 4 - it worked on Windows XP with DirectX 9.0c, too.
Then I installed Windows 7 with DirectX 11 and it works on this machine, too!

It looks like the Z-Buffer could be the problem. The image from above (V-key pressed) looks like the image is splitted into several small parts (lines) of the landscape... that are calculated separately.

I really would appreciate it if more people could test this little test-program and tell me if and how it works.

So far I think it's a hardware graphics problem with DarkBasic because the code works OK on another system.

Thanks so far!

Rylex
Mulderman
20
Years of Service
User Offline
Joined: 8th Jan 2004
Location: C:\\
Posted: 31st Oct 2013 11:01 Edited at: 31st Oct 2013 11:02
Sorry if i missed something (its a long post) but did you try to compile same program in DB Pro and then test it?

Maybe its a bug in DB Classic engine. Works on some machines but not in the others.

Once again, im sorry if missed some info from your first post, maybe you already wrote about it.

EDIT: DB Pro doesnt support matrix generation?
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 31st Oct 2013 12:26
Hi Rylex,

the problem is that if the size of your world is very large, dbc does not like it. The solution is to reduce the scale of your world.

Latch has built a dll(matrix and terrain) that can be useful:
http://forum.thegamecreators.com/?m=forum_view&t=197592&b=10&msg=2361291#m2361291

DirectX 9.0c (February 2010)/ DBClassic v1.20
Rylex
22
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 31st Oct 2013 12:26
Quote: "EDIT: DB Pro doesnt support matrix generation? "


DarkBasic Pro supports matrix generatrion but ALWAYS crashes when using a Fullscreen application and pressing Alt+Tab or Windows key. If you use no matrix you can recover the program with special code (found inside DBPro forum) and reload objects and so on... but this does NOT work with a matrix!

Matrix only works in windowed mode and Fulldesktop (but Fulldesktop has problems with aspect ration for me). So all in all: DarkBasic Pro is not useable for me. I bought it some years ago and never used it for productive tasks - really makes me angry about the money I've spent for such a buggy crap software

But DarkBasic Classic still rocks so it would be great if this problem could be corrected - because I still LOVE DarkBasic!
Rylex
22
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 31st Oct 2013 12:35
Quote: "Hi Rylex,

the problem is that if the size of your world is very large, dbc does not like it. The solution is to reduce the scale of your world."


Hi Silverman,

thank you very much for your answer!
I've tested it with a smaller matrix, too. Just the following parameters:

matrix_width=2100
matrix_height=2400
matrix_blockwidth=150

gives me a matrix of 14x16 tiles. The problem is exactly the same... so this can't be the problem.

The big matrix is handled by both systems above (see pictures).
Exactly the same code runs on one machine without problems and on another machine it causes these errors.

Windows version the same, driver version the same, DirectX the same.

I'm still curious what this could be
Perhaps Latch knows something about this?

Thanks for all your help it's really appreciated!
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 31st Oct 2013 15:12 Edited at: 31st Oct 2013 15:15
Here is a small demo, change the value of the "sco" variable and move the mouse to see if the scene is distorted.
You can also reproduce your problem in the source code, so that we can make tests, it will be easier for us to help you.

You can use darkedit with dbc121, but you have to edit and translate "language.txt" if you want the IDE in German. (Darkedit recognizes the keyboard from your country).
With version 121, you will be able to use commands to create new effects, http://forum.thegamecreators.com/?m=forum_view&t=117150&b=10 and find codes on the forum that use these commands to produce blending effects (check my profile, DarkBasic discussion).

Sometimes the code compiled dbc cause white flashes, to remedy to this, we must add the "setup.ini" (with blitflipmode = 1) with compiled code, or create a function that makes it automatically, like this


DirectX 9.0c (February 2010)/ DBClassic v1.20

Attachments

Login to view attachments
Rylex
22
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 31st Oct 2013 19:56 Edited at: 31st Oct 2013 22:52
Hi Silverman,

this is very interesting what you wrote me.

First: I checked your example: With the value of sco=1000 everything was distorted. The grey pillars on top especially. Take a look at the following picture:



I reduced this setting to 100 or less and the effect was not that visible.

I then went to my program and changed the matrix to 1/10 of its original size. I changed the height values of the camera and so on... everything to 1/10 and it was better. Well not perfect but better. The effect was less visible - but the farer I get with the camera - the more visible the effect is again.

But then I have the problem with my game that everything needs to be scaled down and the speed and everything needs to be changed. Even the camera distange and fog range, too. And the result would not bet perfect like on my pictures with the Pentium 4 above.
Better yes, but not the same quality.

Well... I still don't understand why the Pentium 4 can handle this without errors. I have to mention that the camera distance is set to 6000 in my example pictures seen on top of this thread. So everything is a bit large yes.

Is this really a big problem with a matrix like mine?
matrix_width=6150
matrix_height=7200
matrix_blockwidth=150

Do you think the game will run faster with everything scaled down?
At the moment the game is not playable on an Atom netbook anymore. Okay I've loaded 1000 trees and even though I've programmed an LOD on these trees it still runs at less than 10 fps.

And thanks for the setup.ini code!

Scaling everything down has some disadvantages concerning the position of the objects... you need real numbers everywhere and calculation gets lot of more difficult so I would not do it if there's another way.

And because it works on some systems - I don't understand it

Still thanks so far for the explanations... I mean I could send you the real status of my project but then please contact me via mail. My address is my name here on the forum and I'm on "gmx.de" ... I would send you a test link then. Please include your native monitor resolution... I will then change it for you inside the EXE file. (only if you want to test it)


Update: I found another possibility:
I've changed the camera range from:

set camera range 1,6200

to:

set camera range 20,6200

This improves the problem mentioned above!
That means the front value is increased from 1 to 20... I know this changes the view perspective a bit...
Does anybody know what do I need to do to get nearly the same perspective than before?
I tried to move the camera -19 in z position because the camera front range is + 19... but that is not the same perspective.

Yeah I know it's a noob question... I'm still a beginner I think

And I still don't understand why the camera range 1,6200 works on some systems and on other systems it doesn't!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th Nov 2013 19:49
Perhaps the best way forward is to go around... like use something instead of a matrix - a memblock terrain, vertex moulded terrain, blitz terrain if you have a few bucks going spare.

I know how useful the matrix is, I would still use them in editors, but it's not too difficult to mimic a matrix with memblock meshes, there are loads of examples around. The texturing is probably the issue, the matrix image prep is probably making the images unavailable - but with an object at least you can just re-texture, rather than preparing the image for the matrix. This also would allow terrain shaders, like using a colour mask shader and 3 textures, like sand, dirt, grass.

There are options, but they all depend on moving away from a matrix, and that's not a bad thing - objects are much better for performance, can support shaders and better texturing options, and you'd be able to work around the alt+tab bug. Worth thinking about at least.

I am the one who knocks...
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Nov 2013 02:07
@Rylex

Basically you are getting "z-battles" where overlapped polygons are each trying to be drawn. There's no real control for the z-buffer in DBC and it does seem to behave differently with newer graphics cards.

The further the polygons are away from the front clipping plane (the first number in the camera range setting), the more pronounced the effect. The easiest way to deal with it is to keep the scale of your world down. Physically build your models at the smallest possible size for interaction and movement as can be. Since the closest the front clipping plane can be from the camera is 1 unit, you can't allow movement to get closer to objects than this or you will walk or see through them.

In the case of a landscape, if you are flying high above it, you may notice the effect as well. If you are walking on it, in general it shouldn't be noticed because in theory, the camera will be close to the polygons and the z-buffer will handle the display at that range.

Enjoy your day.
Rylex
22
Years of Service
User Offline
Joined: 5th Nov 2002
Location: Germany
Posted: 24th Nov 2013 10:21 Edited at: 24th Nov 2013 10:22
Hi Latch,

thank you very much for your answer. I've handled the problem now with setting the start camera range to 5 instead of one 1. This improves the flickering quite a lot. I also tried to scale down everything but I was not happy with the result because I would have needed to reprogram everything with real floating numbers because the movement would have been too quick otherwise.

I think it's OK like it is now but I've experienced another problem that 3D objects are not drawn on slower systems. Well... they are loaded and not displayed.
When I press Alt+Tab or Windows Key to switch out of the application and back in again then it works and the objects are shown. So it can't be a memory problem, can it?? Because the objects are really there and not displayed.
Read more about this here:

http://forum.thegamecreators.com/?m=forum_view&t=208902&b=10&p=0

If you have any tipps here I would be very grateful!

Best wishes

Rylex

Login to post a reply

Server time is: 2024-11-21 11:28:16
Your offset time is: 2024-11-21 11:28:16