Ball Race – Days 8 and 9

I just couldn’t stop thinking how cool it would be if the walls of the maze would cast realistic shadows, so on Day 7, I began implementing stencil shadow volumes in my little game. Generating the silhouettes, something I was scared of, has been extremely easy since all you need to do is find all neighboring triangles in a mesh where one triangle is facing away from the light source and the other is facing towards the light source.

Generating quads for the silhouette edges wasn’t exactly difficult either after I already generated the entire maze geometry programmatically. However, I didn’t know what to do about the shadow caps, so I just left them be. This is not a problem because the camera will never enter a shadow volume and the caps will always be clipped by the Z buffer.

Screenshot of a programmatically generated maze with stencil shadows

Finally, it was time to start with the gameplay code. I still needed to a main menu, level selector, the game itself, maze/ball collision detection and some dummy physics to make the ball behave in a realistic manner.

If you’re wondering why this screenshot now shows a Windows Vista frame, this afternoon Windows XP self-destructed and took the whole partition with it. Forced to reinstall from scratch, I decided to check out Windows Vista RC2…

Leave a Reply

Your email address will not be published. Required fields are marked *

Please copy the string vJ56Jj to the field below:

This site uses Akismet to reduce spam. Learn how your comment data is processed.