Sign in to follow this  
GhostAce

Stencil shadow volumes - 2 approaches.

Recommended Posts

GhostAce    138
I have already implemented following approach: - for each model create another model with additional polygons on edges and vertex normals taken from neighbour faces - create volumes by drawing that model with vertex program which will push vertices with back facing normals to infinity (that was only the core of the algorithm) Now I am curious how efficient is this solution compared with computing sillhuette and the capping polygon on CPU (I am not sure if "capping" is the right word - by "capping " I mean the shape that will close the volume). I read about the sillhuette method quite often, but I don't think its faster than the method with precalculated model. There ofcourse would be less triangles but you have to compute the volume for every light and every position change between light and shape on CPU (although you could skip some frames for speedup). Please tell me which method is better (or maybe you know other solutions), and save me some time experimenting with that - I think implementing sillhuette approach would be more complicated than the other one. thx

Share this post


Link to post
Share on other sites
roos    217
I'd imagine it's about the same amount of work either way... as for speed, my guess is that using a vertex program approach is better since it lessens the load on the CPU...

roos

Share this post


Link to post
Share on other sites
paic    645
hi,

depends on your program. The vertex shader way is 100% on the GPU, but on the other hand, you have a lot more triangles to draw. The method using edge detection and construction of the volume on the CPU uses less triangles (can even skip the capping of the volume if you're not inside the shadow volume) so it's more CPU intensive, but you send less faces to the GPU.

So : if you're limited by triangle throughput, use the CPU way (edge detect, etc.) and if you're limited by the CPU (heavy physic engine for example) use the vertex shader way ^^

as for the performances, on a simple test scene, they are quite similar with a good CPU. I didn't test that on more consistent scenes, as I'll use shadow mapping from now on ^^

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