Sign in to follow this  

Shadow volumes and skinned meshes

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

Hi everyone - what's the best way of calculating shadow volumes for skinned meshes? For non-skinned meshes, I'm currently using the method described in the DirectX documentation, where degenerate quads are placed between each shared edge of the original mesh - which adds *loads* more vertices I might add :( This works out quite well though as the CPU has to do zero work - everything is done GPU side. However a problem arises when you want to use skinned meshes, as the 'vertex-normals' are actually the face normals, so the bone influences mess this all up (imagine having different bone influences for each vertex of a face). I've investigated quite a few possibilities, such as recalculating the face normal after skinning in the vertex shader - however this requires storing and skinning the neighbouring vertices for the vertex in question! Quite expensive and loads more memory required :( I believe Doom3 calculates the volumes on the CPU, is this the best answer? Thanks for your time. Jim. ps wish i used shadow mapping now!

Share this post


Link to post
Share on other sites
Hi,

I think the best answer to your question is "do both and profile".
Some notes. There is a sample chapter from ShaderX which tells you how ATI demo team did it for their demo engine. This is the GPU approach.

The link is:
Shadow Volume Extrusion using a Vertex Shader

Maybe you can find something in there (if you haven't already read it).

One note about Doom3. I don't know exactly, because i don't remember the shaders, but i think they not only skin the mesh on the CPU but they create the volume also on the CPU. Correct me if i'm wrong. And if i remember correctly the maximum characters per scene in Doom3 wasn't really big. 3 - 4 i think. Correct me here also.

If you have a fast skinning algorithm (with SIMD and the rest), try doing it on the CPU. It may make no noticable difference in speed, and it will be more memory friendly.

Hope that helps. Anyone has any comments?

HellRaiZer

Share this post


Link to post
Share on other sites
One more comment. If you are rendering your characters with multiple passes (e.g. shading from multiple lights) you should consider building the sv on the CPU (once per frame) as it turns to be more efficient than continusly transforming the vertices with a fairly complex shader. Also consider the same thing with the other (static) meshes.

HellRaiZer

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Um the shadow volumes are in general different for each light.

Share this post


Link to post
Share on other sites
Quote:

Um the shadow volumes are in general different for each light.


The previous post is misleading. Sorry.
Yes the volume is different but the skinned mesh isn't. What i ment is that, when you skin the mesh in a vertex program you need to skin it once for every light. When you skin it using the CPU, you do it once per frame. Then you construct the sv for every light.

HellRaiZer

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
BTW, nothing prevents from skinning a low-res version of your displayed skinned mesh solely for the purpose of calculating the shadow volumes; this model could even have less bones. You will deal with a lesser number of polygons at each frame.

Share this post


Link to post
Share on other sites

This topic is 4304 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.

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