Fog with Blend in OpenGL
- by MhdAljobory
I want to add fog in my scene which contain transparent textures made by Blend ,
when i enable the fog the transparent textures appear white From a distance but when i disable it the textures appear well.
What is the solution to the problem of whiteness?
Fog Code:
GLfloat fogColor[4]= {0.5f, 0.5f, 0.5f, 1.0f};
glClearColor(0.5f,0.5f,0.5f,1.0f);
glFogi(GL_FOG_MODE, GL_LINEAR);
glFogfv(GL_FOG_COLOR, fogColor);
glFogf(GL_FOG_DENSITY, 0.35f);
glHint(GL_FOG_HINT, GL_DONT_CARE);
glFogf(GL_FOG_START, 1.0f);
glFogf(GL_FOG_END, 1000.0f);
glEnable(GL_FOG);
Screenshot