problem with culling of shadow volume side faces

Started by
-1 comments, last by karx11erx 17 years, 4 months ago
While implementing volumetric shadowing (z-fail and z-pass) I have run into a big (for me) problem: Some of the volume's side faces are culled when they shouldn't. Some side faces that are front faces are considered back faces and vice versa. It has something to do with the vertex order of the silhouette edges. If I create the additional vertices for the face by extruding the edge vertices to infinity, it simply depends on whether I render the face in the sequence v0,v1,v1_inf,v0_inf or v1,v0,v0_inf,v1_inf, but this is somewhat random. I have no clue how to fix this. Experts, please help me. :) One hint: My program does all transformations by software, and I am using transformed vertices for these calculations. OpenGL rotation matrices are all identity matrices, and the translation vector is (0,0,0). Example: Here are two adjacent quads of my model: 0 -> 1 ^ . . | | . . v 3 <- 2 3 -> 2 ^ . . | | . . v 5 <- 4 So the vertex order for quad 1 is 0,1,2,3,0 and for quad 2 5,3,2,4,5. Depending whether I happen to process quad 1 or quad 2 first, their common edge will have the vertex order 2,3 or 3,2. This is breaking my shadow rendering. [Edited by - karx11erx on November 27, 2006 11:04:26 AM]
_________karx11erxVisit my Descent site or see my case mod.

This topic is closed to new replies.

Advertisement