Sign in to follow this  
Riviera Kid

Shadow Volumes implementation

Recommended Posts

Hi I am trying to figure out shadow volumes. Here is what i think i should do... ********************************************** generate shadow volumes draw the scene with ambient + emmissive lighting render back faces of shadow volumes (turn off z-writing and enable stencil stuff) if ( pixel pass z-test ) set stencil to on (dont draw here) render front faces of shadow volumes if ( pixel pass z-test ) reverse stencil render scene again with diffuse and specular lighting. ******************************************************* i have never used stencil buffers before so i am not sure if this is doable. But from my pen and paper diagrams it seams as thought the theory is sound. if you are unsure of why my theory works ill explain more. I have a book here "GPUGems" and it uses some crazy intersection tests which seam like a bad idea (to me). Advice please. Thanks. [edit] after some more thinking this implementation may not account for multiple shadow volumes. Still thinking... [edit 2] could work for multiple shadow volumes if i use the stencil value as a flag to indicate what has happened so far, maybe [edit 3] im a bonehead. Ive nearly reached the standard implementation. This GPUGems book doesnt explain this part well. Still feel free to comment.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this