
A lot of newer games are improving their realism by adding real-time dynamic lighting. This demo shows some of the results of my experimentation with phong shading and shadow volumes (generated using vertex shaders). The lighting is produced by two directional sources and one point light source. The demo also demonstrates character movement that is synchronized with its animation. Notice that when the character plants a foot, it isn't sliding as it would if the character was moving at a constant rate. The animation is generated using bones, quaternions, and a state machine to maintain a smooth motion. This system also blends the transitions between walking and standing animations. (The character model and walking animation can be changed by editing the 'game.cfg' file.) The character will actively collide with the floors and walls, but not the rotating torus.
The upper right corner shows your display's refresh rate, the frames per second, and the number of times your computer has failed to achieve the ideal frame rate (misses). (Note: If your computer is missing frames, then the simulation will run slower. The frame rate can be set in the configuration file, so increase the divisor in game.cfg to make things run at the proper rate.)
You need DirectX 9 for this demo. Your card must also support vertex shaders (version 1.1) and pixel shaders (version 1.3 and 2.0). (Both the shadow volumes and skin are manipulated using vertex shaders.) Unfortunately, I can't guarantee that the demo will run properly on your computer because the demo uses a lot of advanced features of Direct 3D. Of course, it runs fine on my own card, which is an ATI Radeon 9700, so it will probably also run fine on other advanced cards.
When looking over the source code, remember that it was developed while learning about the various game development topics in my certificate courses. I personally believe that it is quite good considering that I slowly designed it while never having a full picture of exactly how the final product should work. Now that I know a lot more about how a game engine should be organized as a whole, I am trying to think about and design a good engine before writing the code for it.
1) Use the arrow keys (up, left, and right) to move the character around the room.
2) Use the numpad 8, 4, 6, and 2 keys to rotate the camera view. (The up direction is locked, so you will notice jumping if you move the view directly above or below the scene.)
3) Press the 'L' key to toggle the light map view mode on and off. This mode removes the textures, which makes it easier to enjoy the subtleties of the dynamic lighting.
4) Edit the 'game.cfg' file to change the skin or walking animation. The available options are in the file's comments.
The software has minimal error checking, so it will fail if any of the files are missing, or the hardware or drivers are unsupported.