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

## 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 on other sites
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 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.

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 14
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631757
• Total Posts
3002141
×