I wrote a nice little cube with a texture. I added lighting. I added blending, and it became transparent. When I added fog, the cube became all white. If I turn of the light, everything looks ok. What’s the problem.
Here are the lines ( I consider) important from my code :
GLfloat LightAmbient[]={ 0.5f, 0.5f, 0.5f, 1.0f}; // Ambient Light
GLfloat LightDiffuse[]={ 1.0f, 0.0f, 0.0f, 1.0f}; // Diffuse Light
GLfloat LightPosition[]={ 0.0f, 0.0f, 2.0f, 1.0f }; // Posiiton Light
GLfloat fogColor[]= { 0.5f, 0.5f, 0.5f, 1.0f}; // Fog Color
// in InitGL() :
glClearColor( 0.5f, 0.5f, 0.5f, 1.0f); //Clear Background Color To Gray
glColor4f(0.5f,0.5f,0.5f,0.3f);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);