This was a huge pain to do. In order to get shadow volumes, you have to find the silhouette of your object, from the perspective of the light. Then ...
This was a huge pain to do. In order to get shadow volumes, you have to find the silhouette of your object, from the perspective of the light. Then you have to extrude that silhouette to infinity (represented here by 100 units, which is more than enough) Then, if you're using z-fail, you also have to cap both ends so that the volume is "watertight". If you're using z-pass, then it gets even worse. So I have a ridiculous vertex shader and a totally different mesh data pipeline for these silhouette edges, and it really should have been a geometry shader, but I've only got OpenGL 2.1 so I have to make do. And then I have a second vertex shader and even different mesh data (With each polygon split apart) to generate the caps. The upside of all this is pixel-perfect shadows. They don't look natural, but considering my weak GPU, it's a lot better than heavily pixellated shadow maps. However, I haven't really integrated the shadows with the lighting system, so instead of drawing a shadow, it just draws some sky.
Less
We keep track of your subscriptions through your Facebook account. No additional registration required.
Nothing will be posted to Facebook without your explicit permission.