And please, have you idea, how it should be used? Now, I have in VS code for fog, even if is not needed in FS (FS is dynamically generated). I want leave out calculation of fog, if is not needed. So I did this....
...
#ifdef USE_FOG
varying vec3 fogVertexColor;
varying float fogWeight;
#endif
...
#ifdef USE_FOG
fogWeight = clamp((-v_Position.z - fogStart) / (fogEnd - fogStart), 0.0, 1.0);
fogVertexColor = fogColor * fogWeight;
#endif
And if I need fog, I add "#define USE_FOG" on the first line of VS and FS, but it not works when I turn on fog.
11-06 15:40:34.768: I/jPCT-AE(11566): [ 1352212834770 ] - ERROR: Could not link shader program: L0008 Varying 'fogWeight' not found in vertex shader