Everything is fog , when i enable fog

just like the threads name says, i dont understand why , but after i enable fog , my scene isn`t visible anymore , the only thing i see is dense grey fog …

i use fog in my recently started opengl app , so far i`ve got some models , which i made in 3ds max , and i imported, using the GLM library into my opengl app. my models are a terrain , a skydome and a castle , which are also textured.

ive managed to rotate , scale and translate the objects so that every one is at theyre correct place in the scene .

i also can move “the camera” through the scene with W A S D keys and look around with the mouse.

i also defined a simple directional light.

my light code:

GLfloat ambientLight[]={0.1, 0.1,0.1,1.0};
GLfloat diffuseLight[]={0.8,0.8,0.8,1.0};
GLfloat specularLight[]={0.2,0.2,0.2,1.0};
GLfloat lightPos[]={1.0 , 1.0 , 1.0 , 0.0};
GLfloat specularReflection[]={1.0,1.0,1.0,1.0};


glMaterialfv(GL_FRONT, GL_SPECULAR, specularReflection);

glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientLight); glEnable(GL_COLOR_MATERIAL);

my fog code :

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

glEnable (GL_FOG);
glFogi (GL_FOG_MODE, GL_EXP2);
glFogfv (GL_FOG_COLOR, fogColor);
glFogf (GL_FOG_DENSITY, density);

if anyone has an ideea , please help

i also added pictures

First, do you see something with :
glFogf (GL_FOG_DENSITY, 0.0f);

If true, then you may have a problem with model scale.
Try with very low values, such as 0.0000001 : is it any better ? Try 10x etc.

You may have a transformation problem, remember there are different matrix stacks in OpenGL, and doing modelview transformations in GL_PROJECTION matrix (instead of the correct GL_MODELVIEW) can mess the fog.
Search for “fog” in this page :

thanks a lot ZbuffeR , by reducing the density to 0.0 made fog invisible , after that i set the density to 0.005 , which made the scene and also the fog visible.

but now the fog is through the whole scene , and i would like to make the fog vizible on the y axis only as high as the terrain , so that the skydome is perfectly visible with no fog , otherwise the fog makes the sun unrecognisible

i tried with :
glFogf(GL_FOG_START, 1.0f);
glFogf(GL_FOG_END, 100.0f);

but that would be the depth … changed the params. but dindn`t notice any changes

how could i do that ?

also added pix: