Jump to content
  • Advertisement
Sign in to follow this  
j_smith4

Shadow Volume Problem

This topic is 3851 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

I'm working on getting shadows working in game and am using the Code Sampler version as my base. It works fine as it should, but I gave it a box to generate shadows from and it has some problems. Its creating shadows for the sides of the box and when they get rendered it looks like its causing z fighting with the texture. Is there an inherent problem with shadow volumes and square objects or is the Code Sampler code missing something?

Share this post


Link to post
Share on other sites
Advertisement

I worked with shadow volumes for quite a while before I moved to shadow mapping...if I were you I'd move to shadow mapping now and save yourself the trouble. It ends up being a series of patches all to do shadows for only watertight convex geometry that can't easily animate.

that being said, the box is about the only thing I could do with shadow volumes w/o trouble so it's not that. I remember struggling with the stencil count and shadows on backfaces etc.

have you tried using a bias if z fighting is the trouble?

got screenies?

programmer_tom

Share this post


Link to post
Share on other sites
Animation isn't a problem and I won't be using any odd geom so I want to do it as simple as possible. Here is what it looks like:

Photobucket

All I changed was to make it load my model and when building the shadow I changed the vertex buffer to hold UVs along with the position and normal data it was already reading.

Gamedev has a article on shadow volumes that seems to run better and doesn't have the z fighting problem. Will have to see what is different between the two.

Share this post


Link to post
Share on other sites
I your image the the light direction seems to be exactly coplanar to the faces where the problems occur. This always happens when you draw two planes on top of each other that don't share all their vertices, because of precision problems.
Try changing the light direction.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!