Jump to content
  • Advertisement
Sign in to follow this  
Riviera Kid

Shadow Volumes implementation

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!