Monday, May 2, 2016

What Is Order Independent Transparency?

When programming 3D graphics with something like OpenGL the transparency only works when polygons are programmed in the correct order. A new idea for 3D graphics has emerged called Order Independent Transparency (OIT). OIT algorithms do not care what order the polygons are programmed in. There is one big gotcha with OIT though. Every transparent layer has to be drawn in an off screen buffer then combined at the end of the cycle. This can slow a computer’s performance significantly so I usually limit it to 3 or 4 layers.

Recently, faster OIT algorithms have been made. One of my favorites is Weighted, Blended Order-Independent Transparency by Morgan McGuire.  One big advantage is that it draws everything into one buffer per cycle. This means no matter how many transparent polygons are programmed only one layer is needed. If you would like to read more about this idea check out the links below:

Morgan McGuire’s Blog:

http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html

This site has more working examples with source code that Morgan did not mention in his blog:

https://developer.nvidia.com/gameworksdownload