Hey!

Welcome to Blip, home of the best original web series! When you’re done watching this episode, checkout some of our top shows or learn more about us!

×

lulzfish

In Awe of the Power: Battle with the Shadow Volumes

Other Sharing Options

×
Embed
The embed code has been copied to your clipboard
Share
About this episode
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
01:26
Discover the best in original web series.© 2012 Blip Networks, Inc. All Rights Reserved.