Author Topic: fog formula?  (Read 2321 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
fog formula?
« 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)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: fog formula?
« Reply #1 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.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: fog formula?
« Reply #2 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.