Reverse engineering the rendering of a frame in Deus Ex: Human Revolution

Earlier this year, Adrian Courrèges wrote an article detailing his findings while reverse engineering the rendering pipeline in Deus Ex: Human Revolution.

Starting from a given frame, he illustrates the different stages in the rendering: creation of the G buffer, shadow map, ambient occlusion, light prepass, how opaque and transparent objects are treated differently, volumetric lights, bloom effect in LDR, anti-aliasing and color correction, the depth of field, and finally the object interaction visual feedback.

Here are a few screenshots stolen from his article:

Normal map

The light pre-pass

Final image

Adrian since then posted a new article, this time breaking down the rendering of a frame in Supreme Commander. The comments also include insights from the programmer then in charge of the rendering, Jon Mavor.

Maximizing depth buffer range and precision

Half of the available range is packed into tiny distance from the near plane to twice the near plane distance.

This quote from this article of the Outerra blog is more or less its punch line. The author explains the precision issues with typical depth buffer use, and explores ways to get better results. Since Outerra is a planet engine, no wonder depth precision must be critical.

I discovered Outerra and its blog fairly recently, through a couple of mentions in the Flipcode’s Daily Flip, and was impressed by its rendering. The amount of work that went into it must be insane. See these captures demonstrating the space to ground transition or the grass rendering for instance: