Sign in to follow this  
Hermes

Shadow volume tutorial

Recommended Posts

Hermes    144
Hi i was just wondering ,when casting the shadow and disabling writing into depth buffer( glDepthMask(GL_FALSE)),how is the shadow clipped against the room ?[looksaround] Thanks for your support!

Share this post


Link to post
Share on other sites
Wildfire    154
The shadow-volume does not automaticaly get clipped against other geometry. It will continue right on to the clipping plane of your viewing matrix (and you do not need the depth buffer to clip against that).

The depth buffer contains information on how close the currently closest object is. So that when you render a new object you can determine whether it goes in front or behind the objects already on the screen.
Since the shadow volume itself should not be visible you do not want it to update the depth information. Otherwise you would get funny results, like objects hidden behind the (otherwise invisible) shadow-volume.

Maybe read some tutorials here on gamedev, like 'the theory of stencil shadow volumes'. Or try googling.

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