fog formula?

Started by MichaelJPCT, August 18, 2016, 06:53:59 PM

Previous topic - Next topic

MichaelJPCT

some parts of my scene are rendered with shader while some are not.
i need to know the formula of fog in GL's fixed function rendering and use it in shader so that all parts in the scene have the same fog effect.
i use these settings on the parts without shader:
setFogging(1);
setFoggingMode(1);
setFogParameter(100f,20000f, r,g,b)

EgonOlsen

Have a look into the default shaders of jPCT-AE. They contain fog code that mimics there behaviour of the fixed function pipeline.

MichaelJPCT

i found the fixed function pipeline just uses linear fog. any other curve that i tried doesn't match in the render result.