PDA

View Full Version : Fog Problem.



Lehm
05-29-2005, 07:15 AM
I have a problem with fog. It renders flat, the whole scene is fogged the same color, and the vertices that go off the near plane get colored the pure fog color. It's almost like it thinks the scene is backwards or something. Any ideas?

jide
05-29-2005, 07:37 AM
mmm, I'm not used to do fog. Anyway, you can give some more explanations of what you did, and also put some codes. This will help people here to find out what could be your problem.

Lehm
05-29-2005, 11:18 AM
Well I'm enabling it like so

GLfloat fogColor[4] = {0.5, 0.5, 0.5, 1.0};

glEnable(GL_FOG);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogfv(GL_FOG_COLOR, fogColor);
glHint(GL_FOG_HINT, GL_NICEST);
glFogf(GL_FOG_START, 1.0f);
glFogf(GL_FOG_END, 20.0f); Should probably also note that the znear is 1 and the zfar is 10000.

jide
05-29-2005, 11:30 PM
did you tried to start your fog from a farest value (like 5, 10, 100 or 1000 depending on your scene) and stop it with another value ?