PDA

View Full Version : Practical and Robust Shadow Volumes



lucidmm
04-24-2002, 03:34 AM
Has anyone implemented the algorithm in Cass Everitt and Mark Kilgard's paper "Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering"?

I tried implementing the algorithm in section 3.3, but I'm having some problems. He loads the infinite projection matrix before drawing the scene. When I did this, my whole scene was projected to infinity. It seems that loading the infinite projection matrix should be done before rendering the shadow volumes. Also in the pseudo-code, he calls loadCurrentViewTransform(); Why does this need to be done? The modelview matrix should be loaded with the call to MatrixMode(MODEL_VIEW);

Any help would be greatly appreciated.

Thanks.

[This message has been edited by lucidmm (edited 04-24-2002).]

[This message has been edited by lucidmm (edited 04-24-2002).]

Thaellin
04-24-2002, 03:50 AM
Poor Cass. "Kilgard's paper".

Cass reads the forum regularly and there was an extensive discussion of the paper when it was originally posted not long ago. You could read that thread and see if you find any enlightenment there.

I think the pinf question was discussed.

In regards to 'loadCurrentViewTransform', the matrixmode change will start you working with the top of the modelview matrix stack, but you probably want to use a view position other than 0,0,0 looking down -Z.

Have fun,
-- Jeff

davepermen
04-24-2002, 04:02 AM
how about the demo from nvidia? they made one themself, you can download it on developer.nvidia.com .. incl sourcecode

the pinf matrix should not project everything into infinity... but there are problems with it in the paper (they made some faults) so be sure to take a look at the source..

lucidmm
04-24-2002, 04:28 AM
I searched for relevant posts from Cass, but I came up empty.

I had another question with the paper. The paper claims that to close a shadow volume completely, 3 sets of polygons are needed--
1)possible silhouette edges extruded to infinity; 2) occuluder's backfacing triangles projected away from the light to infinity, with respect to L; and 3) all of the occluder's front facing triangles with respect to L.

I don't understand why 1) and 3) wouldn't be sufficient conditions. I hope someone can help out with this.

Thanks again,
Mike

[This message has been edited by lucidmm (edited 04-24-2002).]

davepermen
04-24-2002, 05:13 AM
because the part of infinity could be visible on screen (remember, the pinf draws EVERYTHING in the frustum from farplane till infinity!)
and then you will have to close the volume to get the correct in-out-count (because for every volume you go in you have to go out.. if not at some finite point, then at the infinity.. http://www.opengl.org/discussion_boards/ubb/smile.gif)

remember you count behind z-buffer.. means from nearest point to infinity..