how do i get opengl to do fog when im in smooth shading mode???
ok here th bit of fog code from my prog
glEnable(GL_FOG); //fog settings
{
GLfloat fogColor[4] = {0.0, 0.0, 0.7, 0.5};
glFogi (GL_FOG_MODE,GL_LINEAR);
glFogfv (GL_FOG_COLOR, fogColor);
glFogf (GL_FOG_DENSITY, 0.1);
glFogf (GL_FOG_START, 1);
glFogf (GL_FOG_END, 10);
glHint (GL_FOG_HINT, GL_FASTEST);
}
glClearColor(0.0, 0.0, 0.7, 1.0);
[This message has been edited by Zerosignull (edited 05-20-2000).]
Kaeto
2
Could you explain the problem in more detail?
Check that blending is on.
glEnable(GL_BLEND);
Did you specify the fog mode?
e.g. glFog(GL_FOG_MODE, GL_EXP2);
ec
to Eric Chan:
Check that blending is on.
Don’t need it.
The fog is independent from blending.
Did you specify the fog mode?
Look at this line:
> glFogi (GL_FOG_MODE,GL_LINEAR);
to Zerosignull:
Make sure that you geometry lies in the fog range. (GL_FOG_START…GL_FOG_END)
btw, if you want linear fog, you don’t need to set GL_FOG_DENSITY.
This parameter is used for exponential fog only.