Author Topic: fog formula?  (Read 522 times)

Offline MichaelJPCT

  • long
  • ***
  • Posts: 136
    • 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: 11745
    • 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

  • long
  • ***
  • Posts: 136
    • 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.