Archived

This topic is now archived and is closed to further replies.

gamelife

skinned mesh + vertex shader + shadow volume

Recommended Posts

I want to implement stencil shadow volume on the skinned mesh sample given in DXSDK9. I understand how to render the skinned mesh using vertex shader (as given in the sample). Now, in order to use the vs to form shadow volume, I need to generate extra geometry (degenerated quads) on the silhouette edges. But I don''t know how to do this on a loaded ID3DXMesh object. Anyone has ideas? Thanks in advance.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
ATi has a nice vertex shader driven depth fail stencil buffer shadow volume demo that with a little work can be converted for ID3DXMesh use. if i can do it anyone can. it uses their own mesh class but it''s pretty easy to convert the code (i think it was only one function/method, the one that takes the mesh data and creates the shadow vertex/index buffer data out of it.)

Share this post


Link to post
Share on other sites
It may help to know some things about ID3DXMesh:

There is only one VB and one IB in a mesh. The IB is organized as a triangle list, not a strip, so working with faces is really easy (no degenerates).

You can directly access those buffers no problem.


I like pie.

Share this post


Link to post
Share on other sites
Hmm, on second thought, I doubt using vertex shader to do shadow volume on skinned mesh would in fact degrade performance. That would require a lot more passes of skinning model-space vertices to world-space (1st pass on normal rendering, 2nd pass on shadow volume generation --- 2nd pass even include many extra ''useless'' vertices for the degen quads).

I think it''s better using software skinning instead of vertex shader for this purpose...

Share this post


Link to post
Share on other sites