Re: dynamic shadow casting

New Message Reply Date view Thread view Subject view Author view

Marcin Romaszewicz (marcin++at++asmodean.engr.sgi.com)
Tue, 15 Jun 1999 15:05:27 -0700 (PDT)


Hi Javier,

Performer currently doesn't support the generation of a shadow map which
contains only a part of your scene, so you'll have to implement your own
drawing routine in a channel draw callback.

Your rendering algorithm will have to look something like this:
1) Clear the depth buffer

2) Render the objects which you want to cast shadows into the depth buffer from
   the point of view of the light source which casts those shadows. You can
   use bins (explained in the pfChannel tome, er, manpage) to select which
   geosets will be drawn.

3) Read the depth buffer values into a texture; this is your shadowmap.

Now, you have to render the scene, and based on what it contains, you will need
a variable number of passes.

Pass 1: If your scene has texture based transparency which makes cutouts in
        polygons, such as in a tree billboard, you need to render the scene
        once and keep track of which parts get rendered and which parts don't.
        You must do this pass first, since when you're rendering the scene
        with the projective shadow texture, you lose this information.

Pass 2: If you have any non-projective lights (pfLight), render the scene with
        only those turned on.

Pass 3: In this pass, set an override to force your shadowmap to be the active
        texture. Set up pfTexGen so that it "projects" the shadowmap from
        the point of view of the shadow casting light source. Render the scene
        using the shadow extension.

Pass 4: Render all textured geometry.

Pass 5: Render all emissive geometry.

Take a look at Angus Dorbie's UAV example on www.dorbie.com to see how this
is done. Angus has an explanation of shadowing as well as sample source code
there.

-- Marcin

> Hello:
>
> We are trying to use dynamic pfLSource shadows, but frame
> rate drops because of multiple rendenring passes.
>
> For our application, there is only one object that casts
> shadows over a complex scenario.
>
> Is there any way to select which objects get rendered in
> shadow map generation pass, so that we can reduce overhead
> somewhat?
>
> (the shadow casting object is moving, so shadow map must
> be recalculated each frame).
>
> Suggestions about other approaches will be welcome.
> Remember: one single moving object casting shadows
> over a complex scenario.
>
> Thank you in advance.


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Jun 15 1999 - 15:05:40 PDT

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