Re: Non-symmetric fog?

New Message Reply Date view Thread view Subject view Author view

From: Radomir Mech (rmech++at++engr.sgi.com)
Date: 08/20/2001 13:25:48


Andreas Ekstrand wrote:
>
> Hi!
>
> I wonder if anyone knows how to implement a fog that not only depends on
> the distance but also on viewing angle? That is, if you are at say 1000
> metres above the ground, observing two objects, one at 500 meters and
> one at 1500 metres but equally far from your position, one of the
> objects could be visible and the other not.
>
> Is it possible to make the pfFog (or glFog) behave this way? Could you
> solve it in some other way - callbacks maybe?
>
> Any comment or suggestion will be appreciated.
>
> Thanks in advance,
> Andreas Ekstrand
>

Hi Andreas,

you can use layered fog in pfEarthSky or in pfVolFog (in 2.4 only).
In pfVolFog, for example, you can set fog density at certain elevation and the
density in between is linearly interpolated. So in your case you can set density
to 0 at 900 and to a value above 0 at elevation 800 and at elevation 0.

You have to call pfVolFog::draw in the draw call back. It draws the scene twice,
first non-fogged and then it blends each pixel with the fog color according to
its distance from the eye and its elevation with respect to the eye.

Check examples in perf/samples/apps/C/fogfly or perf/samples/apps/C++/volfog.

Cheers,
Radomir


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Aug 20 2001 - 13:25:52 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.