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.

Dark GDK / dbFog prolems with GDK 120307

Author
Message
Cap10
17
Years of Service
User Offline
Joined: 9th May 2007
Location: Le Barp, FRANCE
Posted: 9th May 2007 13:26
Hi,

does anyone knows why the Fog function always produces black fog ?

I'm using dbFogColor and dbFogOn to produce fog in the distance of my flight simulator game, but no matter which color I set with dbFogColor, it is always fading black in the distance...

It seems this was a known issue since version 1.62 (I found a thread related to this on that forum dating from 2003... but no answer there).

I'm using Dark GDK update 120307 with visual studio 2005...
This fog feature was working great with DB classic...

Thanks in advance for any help or informations on this matter.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 9th May 2007 22:16 Edited at: 9th May 2007 22:21
Most odd, I thought this issue had been resolved.

Let me check something out...

[EDIT] I'm not entirely sure why you're seeing this problem because I was under the distinct impression that it had been resolved. May need some feedback from Mike, just to be sure that the order of function calling is also relative to fog colour also.

Paul.


Abundance = Choice = Freedom - Scarcity = Dependancy = Control, Truth!
Cap10
17
Years of Service
User Offline
Joined: 9th May 2007
Location: Le Barp, FRANCE
Posted: 10th May 2007 11:20
Hi,

I found that fog color doesn't always fade to black...
Here is the code I'm using to test it:

#include "DarkGDK.h"

void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate(0);

for (int i=1;i<20;i++)
{
dbMakeObjectCube(i,10);
dbPositionObject(i,10*(i-3),10*(i-3),25*i);
}

dbColorBackdrop(dbRgb(200,150,120));
dbFogColor(200,150,120);
dbFogDistance(250);
dbFogOn();

while(LoopGDK())
{
dbSync();
}
}


the fog should fade to the backdrop color, and it's not the case: fog color is like a greenish blue, diffrent from the backdrop color.

In fact, after several tests, it seems dbFogColor doesn't take the Red component into account. If I put dbFogColor(150,120,0) with dbBackdropColor(dbRgb(0,150,120))then it's OK.

So dbFogColor seems to be dbFogColor(int Green,int Blue,0) instead of dbFogColor(int Red,int Green,int Blue)...

That only leaves color with no red... too bad isn't it?! And the color must be set in the GBR order instead of the RGB order.

Furthermore, using the dbRgb function with dbFogColor always produces a black fog, no matter which color is set...

Well that's all I can say about this problem...
Any idea when it will be fixed, or what can be done to work it around ?

Rgds
Bruno.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 10th May 2007 12:25
I tested this for Mike, and it was maked as solved.
Please try this code with a simple red fog, it runs fine here:

Cap10
17
Years of Service
User Offline
Joined: 9th May 2007
Location: Le Barp, FRANCE
Posted: 10th May 2007 15:20
Hi,

the only difference I see between the 2 codes is that dbFogOn is place before dbFogColor on Morcilla's code...

I changed that on my code and now everything is working OK.

So dbFogOn() must be placed before dbFogColor() !

Thanks for your help guys...

Rgds
Bruno.

Login to post a reply

Server time is: 2024-11-19 13:36:57
Your offset time is: 2024-11-19 13:36:57