www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: MichaelJPCT on August 18, 2016, 06:53:59 pm

Title: fog formula?
Post by: MichaelJPCT on August 18, 2016, 06:53:59 pm
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)
Title: Re: fog formula?
Post by: EgonOlsen on August 18, 2016, 07:19:11 pm
Have a look into the default shaders of jPCT-AE. They contain fog code that mimics there behaviour of the fixed function pipeline.
Title: Re: fog formula?
Post by: MichaelJPCT on August 19, 2016, 09:10:43 am
i found the fixed function pipeline just uses linear fog. any other curve that i tried doesn't match in the render result.