Sign in to follow this  
karx11erx

OpenGL problem with culling of shadow volume side faces

Recommended Posts

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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this