PDA

View Full Version : Fog?



cOg
02-14-2000, 11:52 PM
It doesn't matter what value i put in the glFogf(GL_FOG_START, 1.0f);
glFogf(GL_FOG_END, 5.0f);
It always look the same!
Any ideas?

Eric
02-15-2000, 12:39 AM
This will only work with linear fog, so check that you are using this type of fog (and not GL_EXP or GL_EXP2 !).

Moreover, it can be a density problem...

Can you describe more precisely what you see on the screen ? (And what you'd like to see ! http://www.opengl.org/discussion_boards/ubb/smile.gif)

Eric

cOg
02-15-2000, 12:59 AM
Im using GL_EXP2 now.
I want to be able to move the fog forward and backwards, thats what
glFogf(GL_FOG_START, 1.0f); is made for ? or have i got this completely wrong?
I dont have my compiler here right now so i cant try GL_LINEAR right now, i hope that's the problem http://www.opengl.org/discussion_boards/ubb/smile.gif

cOg
02-15-2000, 01:01 AM
oh i forgott, when i use GL_EXP2 i see fog but i cant change it forwards and backwards only the density.

Eric
02-18-2000, 02:53 AM
The GL_START and GL_END tokens will only work with linear fog. You can not set fog start and end for exp or exp2 fogs !

You should have a look at volumetric fog topics if you are looking for more realistic fog than basic OpenGL one...

Eric

Antoche
02-18-2000, 12:18 PM
Remember that exp(0)=1, and linear(0)=0, so the fog is *really* different if you are in exp (or exp2) or if you're in linear !