Atmospheric haze

Started by AW999, December 21, 2009, 12:11:19 PM

Previous topic - Next topic

AW999

Since the built-in fog effect apparently works well only when the fog is 'black' (according to one of the files or wiki articles), what's the best way to produce atmospheric haze - i.e., making distant parts of the landscape look bluer? 

EgonOlsen


AW999

Quote from: EgonOlsen on December 21, 2009, 12:29:42 PM
...using which renderer?

  Well, ideally I'd need my applet to be as widely compatible as possible, so presumably all of the rendering modes.

EgonOlsen

I see. The limitation of the fading color is valid only for the per polygon fog mode, which is default but actually outdated. You can enable per pixel fog for both renderers with any target color you like. For the hardware renderers, there's no problem with that at all. For the software render, the fog is applied in a post processing step based on the data in the depth buffer. This costs some performance (but benefits from multi core machines) and it has a problem with transparent objects. If this applies to your application, have a look at http://www.jpct.net/forum2/index.php/topic,1436.0.html for solution.