We can extrude the shadow volume with vertex program/shader. But if you want it completely done on GPU. There are a few choices:
- Extrude every edge, three per triangle, that’s fill-rate intensive.
- For every edge, check if it is silhoulette edge. then extrude the vertices only on silhoulette edge. But still a lot geometry, and you can’t access other vertices in vertex shader, so you should store a lot of extra things in you vertex data.
When using CPU to do it, we won’t worry about that. But which way is faster. If there is a lot of polygons. Detecting silhoulette on CPU is quite an expensive task.