First of all, sorry for missing the deadline on my first post. x___x Let's hope uni is less intensive in the future...

This week saw the addition of a number of new features. I thought I'd write about the two most visual ones.

The first feature is procedurally generated moss applied to the terrain. It can be used to essentially override certain parts of the terrain's textures with a moss texture. Even cooler, the moss changes the light properties of the terrain, so moss growing on metal will reflect light as moss should, not as the underlying metal.

With proper lighting applied, it all looks decent, but when there is no direct lighting and only ambient lighting is applied, the result is really unpleasant.

Every single detail in the terrain melts together to one incomprehensible mess. I can't even see where the floor ends and the wall starts.

The solution was the (re)implementation of SSAO into the engine. SSAO is short for ScreenSpace Ambient Occlusion. It's a technique first introduced in Crysis 1 that essentially analyzes the scene and dims pixels that are deemed to be partially occluded by surrounding pixels. Not only does this look pleasant, it also massively increases the depth perception of the scene and makes it easier to understand the shape of the objects in it, as it more closely mimics how the scene would be shaded in real life.

Notice especially how the details on the floor and the walls are much easier to see. I also spent quite some time optimizing the shaders and packing the data together more efficiently to improve performance to less than 1ms at 1080p at high quality. The SSAO can also be tweaked to run on significantly weaker hardware than mine at reduced quality.

In addition, for the last month or so we've been doing extensive optimizations of nearly all parts of the engine.

We identified a massive GPU bottleneck when there were lots of AI entities on the screen. Even though they were barely visible, they were made out of tens of thousands of triangles, which slowed things down immensely. To prevent this, I recently added a LOD (Level Of Detail) system to the model renderer, allowing us to switch out high-quality models for lower-quality models once they're at a sufficient distance from the camera that the difference is negligible. Our modelers will be providing multiple versions of each models with different triangle counts, that Brayden in turn will incorporate into the game through the LOD system I made, so this was essentially something that everyone in the team helped accomplish.

On my end, I've also done a number of optimizations specifically targeting low-end hardware. I've gone through almost all shaders the game uses and optimized them as much as possible. The post-processing pipeline has been restructured to be faster, more modular and enable new features in the future. Many features (for example distortions and shadows) that were permanently enabled before can now be toggled on and off to cram out some more frames per second on the slowest of hardware out there.

Here are some examples of performance wins you'll see in the next version.
- LOD system: 200-300% increase in FPS with 100s of AI on the screen at lower graphics settings.
- Motion blur: Approximately 10-20% faster depending on hardware.
- Postprocessing: Several stages have been merged to a single stage, providing a small 5-10% boost.
- Transparency effects: Small optimizations, plus quality improvements to particle motion blur.
- Rendering: Reduced VRAM bandwidth usage by 15-30% depending on settings.
- Lighting: Reduced VRAM bandwidth usage by 15%.
- VRAM usage: Reduced by approximately 10-15%.