Jump to content
  • Advertisement
Sign in to follow this  
dpadam450

shadows

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

Im trying to figure out how to do shadows if I am projecting onto a rounded terrain. I was thinking of extruding all the verts of a mesh till they collide with the ground and then draw the mesh with black. The only thing is if I have a square and the points are all drawn onto a smooth surface, then the shadow will be flat instead of round. I have no idea what to do with this and I dont know anything about the stencil buffer (I assume I dont necesarrily need it).

Share this post


Link to post
Share on other sites
Advertisement
There's a method known as "Z-Pass Shadow Volume". It's a fairly large and complex subject but here are some hints and hopefully you'll start looking for the complete material and study it :
1) You definitely need the stencil buffer - so start by learning how to use that first. Basically, the stencil buffer lets you draw only certain areas of the final image and you can define these areas on a per-pixel basis with logical operations involving the z-buffer (at least that's what you use when doing shadows).
2)This method works with any number of lights in the scene, and the core part of the algorithm is quite simple. Here's the documentation : "Improving shadows and reflections via the stencil buffer" by Mark J. Kilgard - just do a search on this.
This is a nice algorithm as it uses a volume shadow as the name implies, and so it doesn't matter what the surface the shadow will fall upon because it will fall correctly.

Share this post


Link to post
Share on other sites
There are two basic standard techniques for dynamic shadows: Shadow Volumes and Shadow Mapping. Each has advantages and disadvantages and each has several extensions for performance and/or quality. Mocanu Razvan mentioned shadow volumes, so here is a paper on shadow mapping. There is a LOT of information on both of these techniques on the web, so Google should turn up some more good links for both.

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!