I’ve spent the last few days working on spatial partitioning, object pooling code (and fighting with stackoverflow about it), and other necessary performance optimization code.
Most AAA titles seem to support something like 5-6 dynamic lights. I’m sure you’ve noticed by now that this game takes place mostly in the dark, and I plan on making it darker still (if I can). Well placed lighting will play a big role in making things look interesting, as well as just being able to see your surroundings.
Pre-pass or fully deferred rendering would allow for many lights with little work, but these rendering schemes don’t support MSAA or, more importantly, transparent objects. Also, deferred lighting is not a very good fit for the XBOX, due to it’s 10MB EDRAM and predicated tiling, and it’s relatively low texture bandwidth. I did spend a little bit of time playing with J. Coluna’s pre-pass rendering code on the XBOX a few days ago, but the lighting quality was very poor when used with the XBOX HDRBlendable format (which is 10 bits per channel plus 2 bits left over).
By partitioning the space into a grid and registering objects and terrain chunks into it, I can currently draw 30 point lights at once on the xbox (at 60 FPS). The CPU speed is the limitation so far, not the graphics card.
Of course, that is with just the terrain. Things will get a lot slower when I start adding trees and other objects.
And I haven’t mentioned shadows yet.
In order to be able to set the game in the dark atmosphere that I’m going for, I’ll want to have at least 20 point lights, though I might be able to get away with casting shadows from only 10 or so.
I’ve starting writing some basic rigid body physics. I have projectiles working that can detect collision, but do not react to collisions appropriately yet. Actually the lights in the picture above are projectiles launched from the camera’s position.
I’ve also built a framework for making explosions of various types, complete with flying debris.
The explosion above uses a fairly flexible Explosion class that I wrote yesterday, so new explosions can easily be created with little code at this point. Most projectiles that the player can fire will need some sort of explosion, so recreating an explosion type effect will happen often. This could be used to display the destruction of a crate for example. Just replace the explosion particles with subtle smoke, and the debris with broken wood models. Since the explosion debris are projectiles themselves, they can have their own explosions, which can have their own debris, ad infinitum.