card: nvidia 6800GT
driver: 81.95
I've a simple shader, which consists of just a fragment shader.
The gl_FogFragCoord built-in varying variable seems to always be set to zero, even though I have exp2 fog enabled in the application.
I've tried "glHint(GL_FOG_HINT, GL_NICEST)" but get the same result.
Any ideas?Code :vec4 applyFog(vec4 fragColour) { const float LOG2E = 1.442692; // = 1/log(2) float fog = exp2(-gl_Fog.density * gl_FogFragCoord * LOG2E); fog = clamp(fog, 0.0, 1.0); return mix(gl_Fog.color, fragColour, fog); } void main() { gl_FragColor = applyFog(gl_Color); }



