Original Post
Greetings
I apologize in advance if this has been asked before, but with the search function dead, and being unable to manualy look back past page 2 makes it difficult to find existing threads. Links to past threads that anyone may have bookmarked would be greatly appriciated.
I currently have a partly working z-fail shadow volume implimentation in DirectX, using degenerate triangles and a vertex shader to do the shadow volume extrusion. Its "partly" working because I haven''t yet made it extrude to infinity, which is what I''m having problems with. So I have a few questions trying to understand how this should be setup before I try to impliment it.
And I''ve read through the article here on gamedev, as well as many of the references provided in that tutorial, but non seem to quite clear up these things for me.
1) Its my understanding that for verticies that need to be extruded, you pass in the vector along which the extrusion should be done (with w=0). However I''m not quite sure at what point these vectors should be applied. The article on here says not to set w=0 untill after the world-view-projection transformation, but that seems to dissagree with the other material I''ve read.
2) For a directional light, because the light extrusion direction is constant, would this mean all points to be extruded would become identical vectors pointing in the direction of the light?
3) For point lights, the extusion vector seems to become (LightPosition.w*Vertex.xyz-LightPosition.xyz,0) (might be wrong, taking it from memory). Multiplying by LightPosition.w would seem to imply the lights been transformed and thus has a non-one w. Would this be the light coordinate passed through world-view-projection? And thus the vertex coordinate would also be passed through world-view-projection, and the output vector would be the difference between the two in projection space? (This would answer 1 I guess)
4) The infinite view projection matrix. I tried throwing this into my existing setup in hopes of getting rid of the far-clipping problem with the result of the shadows vanishing completely. This wasn''t using the w=0 setup, just extruding the shadow volumes a fixed amount. Question here is, does that matrix not work with non-semi-infinite shadow volumes, or did I just mess up in setting up that matrix somehow?
Thank you in advance for any responses, I''ve been puzzling over how this works for a few days now and feeling kinda frustrated ;P Also if any of my questions are unclear I''ll try to rephrase them.
Kyardan