Jump to content
  • Advertisement


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


A question about the generation of shadow volumes

This topic is 6033 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'm going to implement shadows in my engine using stencil shadow volumes as soon as I found a way to render the faces of the shadow volumes. I haven't searched on Internet a technique to render them now, so what I am going to say may be wrong or not optimized at all. I'd just like you to point what is wrong in my method. So here we are! We want to extrude a shadow volume for every triangle of a scene. So we need the face of the triangle, the back face of the triangle projected far away and 3 faces linking the front and back faces. The front and back faces are simple triangles, these are easily created. The front one is the same as the triangle face, the back one is created with vertices of the triangle extruded using the light to vertex vector (the face is also flip in order to be back facing). But building the 3 polygons describing the shadow volume between the front and back faces isn't so trivial. We need two triangle for each polygon. Given a triangle edge we could do this: For building the first triangle: we take two of the already existing vertices as they are, and another one with the same position as one of the vertices of the edge but we flip his normal. Then we project away only the vertices whose normals are back facing the light. This gives us a half of the final polygon. For the second triangle: we only take one vertex as it is, for the two others we take once each vertex describing the edge and we flip their normals. Then we project away only the vertices whose normals are back facing the light. We now have the final polygon for one edge, we do the same process for the two other edges to get the last polygons needed. In order to do this process, we need to create 8 triangles for every triangle in our scene. Now that I think about it, the number of extra triangles needed seems pretty big... I hope you will try to correct or to enhance my method. Thanks! [edited by - Alload on June 5, 2002 11:48:35 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!