Saturday, July 25, 2009

Project Mod SVN 10

Tonight I added an HDR deferred shading system:

  • A simple shader writes surface color, normal, and world position to a trio of RGBA16F screen-sized textures.

  • The blend target (a fourth RGBA16F screen-sized texture) is cleared.

  • For each light in the scene one of the light shaders uses the three deferred textures to compute the light's contribution to each pixel, which is added to the blend target.

  • The tone mapping shader exposes and gamma corrects each blended pixel and writes them to the back buffer


I'm cheating right now by hard coding a point light and a spot light into the renderer code, but it should be easy enough to generalize. The code is a bit ugly, but it's all confined to the renderer class.







Up next: shadow mapping.

Friday, July 24, 2009

Project Mod SVN 9

Here's the evening's update. I implemented controllers, which basically have a step function and can manipulate things. Player is a subclass of controller with two additional functions: getViewPos and getViewQuat. The game client uses these to control the camera. To test the framework I wrote a CarPlayer class that manages a few rigid bodies and constraints to make a simple front wheel drive car with steering.



Next up:

  • Lighting - I implemented a hacky shadow mapping system after SVN 7 which looked really nice, but I set it aside because the code was so ugly. I'll need to think of a way to keep the GL state management code out of the SinglePlayerGame class, and maybe split some of the texture/model management from the GUI class into some kind of video state manager.

  • Screenshot / video capture - For the spamming of YouTube, and because this build looks much cooler in motion.

  • More test textures and models - This will not be one of those cool but ugly open source projects.

Thursday, July 23, 2009

Project Mod SVN 8

This car thingy consists of five rigid bodies, five collision objects, and four hinge constraints. Keyboard input applies locally-aligned torque to each wheel. Up next: controller objects. These will be non-physical, but will be allowed to interact with bodies, solids, and constraints. The player object will be a special controller subclass with access to input devices and ability to control the viewpoint.

Tuesday, July 21, 2009

Project Mod work

I've been working on Project Mod, my grand vision for an open-source-powered multiplayer physics sandbox game. As usual, I've thrown out a good chunk of the old code and have started (mostly) anew. This time my first focus has been a usable GUI layer for configuration and game selection. I just committed SVN revision 5, and this is what it looks like:


Main menu with some buttons


Video settings menu with buttons, a drop list, and a checkbox

At the moment the "game" is just a white rotating quad, but the core code incorporates ODE and should give me tumbling boxes soon enough.

For anyone interested (all zero of you subscribers from the internets):
Google Code project page
SVN repository

Building on Linux is easy: go to the /mod3client folder and make run, or make all && build/linux/mod3client if you really like typing. Building on Windows works, but isn't as automated. I've made it work with Visual C++ 2008 Express, after setting up all the requisite libraries, by dumping the source into a Win32 Console Application and changing a few project settings.

Up next: importing my old model loader, and upgrading the game to involve something exciting like box sliding.