Sign in to follow this  
dpadam450

shadows

Recommended Posts

dpadam450    2357
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
Mocanu Razvan    166
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
Kalidor    1087
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

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