Sign in to follow this  

Shadow volume from skinned mesh?

This topic is 4278 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 have shadow volumes (based on the DXSDK sample) working fine from static objects, and I have skinned meshes (also based on the DXSDK sample) working fine, but how would I go about casting a shadow volume from a skinned mesh? The DXSDK sample basically creates a seperate mesh used for rendering the shadow, but it is just one static mesh, so I am not quite sure how to go about creating a shadow mesh to work with animation. I unfortunately found nothing about this searching around on Google, so I was wondering if anyone knew of any samples of tutorials on the topic. Thanks, -Chris

Share this post


Link to post
Share on other sites
I still have to look into this more fully myself, but conceptually my approach would be to create the shadow mesh with the degenerate quads as a seperate animated mesh. Since you should only be adding vertices to existing positions to accommodate for the quads (dunno about capping for z-fail), you can use the same bone influences from the original mesh.

You can then animate the shadow mesh in a HLSL shader and extrude the vertices that are facing away from the light on the fly. This should theoretically also work on < SM2 hardware, but to keep the shaders simple I'd just use SM2 for the minimum spec, since you can probably do it all in one pass then.

Hope this helps a little bit :)

Share this post


Link to post
Share on other sites
That is how I was thinking of doing it myself, the problem is that theory is as far as I can get with this, the implementation proves much more difficult. I suppose I will have to find some way to create the seperate shadow mesh from the actual mesh, but I'm not too sure how to go about doing that at the moment.

-Chris

Share this post


Link to post
Share on other sites
As I said, I'm still trying to figure this out myself too, especially how to use the animation on the Shadow Mesh, ie. how to programatically animate a programatically created shadow mesh, given an animated base mesh?

For testing, you might want to try to animate the original mesh in HLSL and use the volume extrusion on it directly. This is bound to give some artifacts, but if viewed from a sufficient distance this shouldn't be too noticable. And once you have this rendering in place, you can always substitute the animated shadow volume mesh for the original one later.

Share this post


Link to post
Share on other sites

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