Re: pfLightSource and pfFrustum

New Message Reply Date view Thread view Subject view Author view

John Rohlf (jrohlf++at++tubes)
Wed, 24 Jan 96 17:10:03 PST


>
> Hello pfReaders,
>
> I'm having difficulties generating shadows with pfLightSource. I've used the
> example in /usr/share/Performer/src/pguide/libpf/C++/shadows.C and removed the
> PROJTEX light source to concentrate on shadows only.
>
> Depending on the model loaded, the shadow will sometime disappear into the
> floor, flicker through the floor, be clipped by some plane (which, I suspect,
> are part of the light source frustum) or not be visible at all. The sample
> program works relatively well when tested with x29.sv

        To avoid z-fighting, make sure you either have a local light
        or are using a local pfLightModel. This is a RealityEngine
        bug/feature.

> The man page mentions that a pfFrustum is required by the pfLightSource. That
> pfFrustum should tightly bracket the scene to be shadowed for best results.
>
> What is a nominal and non-transformed pfFrustum?

        A nominal (or non-transformed) pfFrustum is one whose eye is at
        the origin and whose view direction is the +Y axis. This is what
        you get when you call pfNewFrust(). Once you transform a frustum,
        either explicitly with pfOrthoXformFrust or implicitly with an SCS/DCS,
        you no longer have a nominal pfFrustum.

        Note that an SCS/DCS above a pfLightSource does *not* change its
        pfFrustum, rather it transforms it so to move a pfLightSource
        around, just stick it under a DCS and attach a nominal pfFrustum.
        Just make sure that the FOV of the frustum is wide enough
        to encompass those objects you which to shadow. But if you make
        it too wide your shadows will get blocky.

> Since objects are moving, is it necessary to recompute the frustum every
> iteration?

        No.

> Is the frustum from the light source point of view?

        Yes.


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:18 PDT

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