Sign in to follow this  
godmodder

Shadow Volumes optimizations

Recommended Posts

Hello, I've successfully implemented ZPass/ZFail shadow volumes in my engine. I now want to optimize them, so they allow for higher framerates. I wanted to render my volumes using GL_QUAD_STRIP rather then standalone quads, but I don't really know how to do this. Some online papers mention that I'm required to calculate possible silhouette loop connectivity. Well, I think I've already calculated this, but I'm not sure. The NeHe tutorial on shadow volumes talked about finding the "neighbouring indices" and the "face connectivity". My question: is this the same? and how do I render the quad strip when I have the right data? PS: If anyone knows how to render shadow volumes with external triangles, please explain this too if you want.

Share this post


Link to post
Share on other sites
Quote:

silhouette loop connectivity


i think that means a closed loop of all edges of the silhouette. If you have that you can just duplicate every vertex on that edgeloop,shift it away from the light and construct the trianglestrips like that:

vertex1,shiftedVertex1,vertex2,shiftedVertex2,vertex3,shiftedVertex3,etc.

the link by Krzysiek K surely helps to improve performance even more but it requires you to add degenerated triangles on your mesh.

regards,
m4gnus

Share this post


Link to post
Share on other sites
Thanx for the info. Does anyone have any info about using external triangles to improve performance?
I'll look at using a vertex shader to improve performance, but does anyone have a link to info about the semi-automatic method. I'd like to let the CPU calculate the silhouette and let the GPU extrude the vertices. That way I won't have to insert redundant data into the vertex array.

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