shadow volume in the vertex shader [solved]
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]
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.
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.
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
Do you have further resources/papers according this topics?
Thanks,
Constantin
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement