Pregunta

I used glFogCoordEXT to distinguish explored and unexplored terrain. But after i use a shader for normal mapping on terrain, its working fine but the fog is no more there.

can some one help me, (i don't know glsl).

¿Fue útil?

Solución

I think you used the fixed-function-pipeline before? By using a custom pixel-shader you "overwrite" the fixed-function-pipeline. You have to manually add fog to your pixels inside the normal-mapping-shader, but that is difficult without any knowledge of GLSL. You may try googeling for GLSL fog, there are plenty of fogging-functions for GLSL that work with the built-in variables (which are edited by glFogCoord). You can then try to wire this function into your normal-mapping-shader. Read a tutorial about vertex/pixel shaders before, they are not that hard to understand. Shaders are just mathematics, the language itself is much easier than the C++ code of the actual program.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top