Fog questions...

I’ve ben playing around with fog, but it hasn’t been working like i want it too… here’s the code so far:

    GLuint fogMode[]= { GL_EXP, GL_EXP2, GL_LINEAR };	

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

    glFogi(GL_FOG_MODE,  fogMode[0]);	

glFogfv(GL_FOG_COLOR, fogColor);
glFogf(GL_FOG_DENSITY, 0.7f);
glHint(GL_FOG_HINT, GL_DONT_CARE);
glFogf(GL_FOG_START, 500.0f);
glFogf(GL_FOG_END, 1000.0f);
glEnable(GL_FOG);

I want the fog to start way off in the distance, but however i set Gl_START and GL_END it is sitll the same, please help!

Try using negative numbers. I am just guessing here since I never worked with fog.

glFogf(GL_FOG_START, -500.0f);
glFogf(GL_FOG_END, -1000.0f);

I´m not sure, but i think the START and END parameters only work for linear fog, not for exponential.

Jan.

yes, GL_FOG_START and GL_FOG_END are the linear fog’s paramaters.
GL_FOG_DENSITY is the GL_EXP and GL_EXP2 parameter.

also, the start/end parameters are in the range 0-1; 0 is the near plane and 1 is the far plane.

Huh?

GL_FOG_START and GL_FOG_END are straight z values…they aren’t normalized to 0->1.

are they?
hmm
my bad. :-/
I thought they were taken from the projection matrix. but maybe I am just confused