Jump to content
  • Advertisement
Sign in to follow this  
cmptrgy412

Creating shadows after bone shader calculations?

This topic is 4551 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 am new to shaders. I was wondering how one generates volume shadows on a model after it has been manipulated by bones in a vertex shader. I thought that after polygons have been through a vertex shader it goes straight to fragment shaders or is it possible to return data back to the main program in order to create the shadows needed. Or am I thinking through this too hard. Should I just make a bones program that works on the cpu? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
The only way you could do shadows would be to use shadow mapping. If you want to use shadow volumes, you will need to do the skinning on the CPU.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Not actually true. There are several methods for doing the shadow volume extrusion on the GPU (see http://www.gamedev.net/reference/articles/article1990.asp for one example, although I haven't looked closely at that article). If you do this, you can do the skinning of the vertices on the GPU, followed by the extrusion on the GPU, with almost no CPU work!

Share this post


Link to post
Share on other sites
There are at least two ways that skinned characters can be used with stencil shadows.

First, you can skin in software (on the CPU), and extract the geometry after skinning. Doom 3 does this (I believe it uses light-facing edge tracing to generate the volumes).

Second, you can create a separate shadow volume geometry: replace each edge between triangles with a degenerate quad (two triangles), and use face normals in each triangle. The quads use the face normals for face A on the two vertices making the edge towards A, and the face normals for face B on the other two vertices. Then, in the shader, do a dot between normal and vector to light; if less than zero, extrude that vertex away from the light.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!