www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AW999 on December 21, 2009, 12:11:19 pm

Title: Atmospheric haze
Post by: AW999 on December 21, 2009, 12:11:19 pm
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? 
Title: Re: Atmospheric haze
Post by: EgonOlsen on December 21, 2009, 12:29:42 pm
...using which renderer?
Title: Re: Atmospheric haze
Post by: AW999 on December 21, 2009, 08:11:00 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.
 
Title: Re: Atmospheric haze
Post by: EgonOlsen on December 21, 2009, 08:53:52 pm
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 (http://www.jpct.net/forum2/index.php/topic,1436.0.html) for solution.