Jump to content
  • Advertisement
Sign in to follow this  
conman

shadow volume in the vertex shader [solved]

This topic is 4727 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, in the last days I tried around a little with an easy way to generate shadow volumes with a vertex shader. In the end it didn't work out totally - but I like the idea because it let's you use the robust zFail method without additional computation of the volumes caps. I summed it up, take a look... What do you think? Is it come to an dead end or is this approach maybe fixable? Constantin [Edited by - conman on June 15, 2005 10:05:41 AM]

Share this post


Link to post
Share on other sites
Advertisement
That's the simplest way to use existing geometry, but as you found, it doesn't work that well on low tesselated geometry.

The next step up is to generate a faceted mesh with normals pointing in face normal directions, and then putting sliver quads inserted in each edge. Running the same algorithm on that representation would generate the correct shadow -- but at a 3x increment in vertex load. It's all on the GPU, though.

You have to be careful to make your shadow sliver geometry be invariant with your rendered geometry, though, else you'll get artifacts on the actual rendered surface. Another trick to watch for is pushing the FRONT faces backwards, and reversing the winding rule.

Share this post


Link to post
Share on other sites
Thanks for your fast reply, but I must say I didn't understand both approaches: the part with the sliver quads and the pushing of front faces backwards :(

Do you have further resources/papers according this topics?

Thanks,
Constantin

Share this post


Link to post
Share on other sites
hi,

I didn't know the term "silver triangle", I remember of "degenerated triangles" but it's the same I guess ^^
Well, the extrusion by the vertex shader is a good approach, but to solve your problem, you have to modify the geometry. Take a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/TutorialsAndSamples/Samples/ShadowVolume.asp
I explains the algorithm to use stencil shadow volumes with a vertex shader for the extrusion

Share this post


Link to post
Share on other sites
paic, thanks for you link!!

That is exactly what I was doing, and they give me also a solution to my problems I had with this technique.

Constantin

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!