Well I'm actually not quite done with the imposter system...I have to extend it to work for actors & vehicles, should be done tommorow.
POST PROCESSING OPTIMIZATIONS
Previously I was rendering the bloom / motion blur / depth of field in seperate passes and it was totally fill-rate limited because I was doing the effects @ screen resolution [well the motion blur at least]. I was unable to get more than ~80 FPS on my computer [DualCore 2.4 Ghz, 2 GB RAM, Geforce 8800] @ 1024x768...
Now I combined them all into a single pass & shader...which just operates on a single A8R8G8B8 512x512 texture and then blurs it into a 256x256 texture which is then used for all post processing effects. I write the x velocity of each pixel into the r, the y velocity into the g channel. I also write the depth of field value into the b channel, and I'm using the alpha channel to modulate the heat-blur effect.
Here is a screenshot of the motion blur with a left -> right camera movement...
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess20.jpg)
Early Depth of field screenshot...
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess9.jpg)
Another one...I've move the far plane even farther back since this screenshot...I think it adds a mysterious atmosphere to the game ;-)
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess10.jpg)
Actually these screenshots are wrong because the sky was being cleared to "full motion blur in all directions" so it's double blurry...
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess12.jpg)
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess13.jpg)
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess14.jpg)
Bloom...
![](http://www.radioactive-software.com/gangwar/Apr12/PostProcess19.jpg)
IMPOSTER RENDERING
Yea so the theory behind an imposter system is that instead of rendering a mesh you render a dynamic 2d sprite of the distant mesh instead. The cached sprites are generated in real-time by rendering to a texture.
This is going to be applied to all meshes in-game...actors, vehicles, objects. That was the big-time bottleneck before this.
Reference image showing a field-o-objects...~1000 of them to be exact. Notice the 14 FPS in the bottom left of the screenshot. Not good.
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterReference.jpg)
Now using an imposter system....117 FPS.
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP14.jpg)
That is actually totally limited by the shadow maps I'm using a 2k^2 texture and a 1k^2 texture at the highest settings. It scales down to use 2 1k^2 shadow maps, and the frame-rate goes up.
Also it should be noted that actually rendering a city will take the frame-rate down by about 30%. The cities just sit in static VBs 90% of the time, and render quite fast.
Another screenshot with shadows turned off...205FPS. The tree mesh is ~550 triangles. There are ~1000 of them.
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP12.jpg)
Debug output of the imposter textures...
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP8.jpg)
Older/incorrect screens...~1000 trees, 500 tris each.
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP9.jpg)
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP7.jpg)
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP6.jpg)
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP4.jpg)
I'm getting this to work with the actors...it's just about done. Totally limited by the shadow map rendering...if I render no imposters / meshes I still get 150FPS with the 2k^2 shadow maps regardless of screen resolution.
![](http://www.radioactive-software.com/gangwar/Apr12/ImposterWIP10.jpg)
These things can pan-out very differently on different hardware, so I've got some testing to do...but it's obviously going to be a major tool in keeping the frame-rate playable on lower end computers.
Also for those of you who want to be in the beta [grin] here is how my to-do list is looking...
-Get 3rd and hopefully final iteration of traffic AI working.
-Finish orders/gameplay aspects.
-Client side prediction on vehicles + actors to make network play seamless.
-Finish basement/illegal business artwork.
[DONE]-Imposter Rendering System
-City Editor / City format 2.0
[DONE]-Optimize Post processing / light weight bloom
I dunno...a month+ probably but we'll see how things go...
Thank god I'll be able to use this tech for any other games I come up with. I think I could use all this as a base and crank out pretty much anything in a matter of 1.5 years...verses the 3 years it has taken me to learn / code all this stuff.
- Danny