Reverse Z Cheat Sheet

Started by JeGX, January 03, 2018, 07:53:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Just recently I've started looking into ways to optimize the depth buffer precision for large draw distances and one specific approach caught my eye again. A technique which is now commonly referred to as Reverse Z. While it comes with just a few minor changes, the results can be quite considerable.

That considerable everyone should just go ahead and use it.

The general idea itself is actually very simple: instead of mapping the interval between the near and far plane [zn,zf] to [0,1], a special projection matrix is constructed in a way that it is being mapped to [1,0] instead.

Why this actually increases the depth buffer precision is not directly obvious, but I will also not go into detail here. I've added some references to articles on this topic at the end of this post.