Thoughts About the ZP+ Alorithm

Eric Lengyel   •   April 18, 2005

A couple of months ago, a paper entitled ZP+: Correct Z-pass Stencil Shadows came across my inbox. I gave it a cursory scan, but nothing earth-shattering jumped out at me, so I didn’t give it much more thought. Recently, the paper has been brought to my attention several more times, so I decided to take a deeper look.

In general, I think the ZP+ algorithm is a poor substitute for a robust implementation of mixed z-pass/z-fail. Here are my reasons:

One more claim that the authors make is that z-fail can be up to 80% slower than z-pass. I ran some tests in the C4 Engine, and found that forcing z-fail all the time was an average of 9% slower than using z-pass all the time. (Of course, using z-pass all the time produces artifacts.) Rendering shadow volumes robustly with mixed z-pass/z-fail was only 6% slower than using z-pass all the time. In my opinion, this is pretty good, and the hassle of something like ZP+ simply isn’t worth it.