DX11 Order Independent Transparency
This is my implementation of the ATI DX11 linked list OIT algorithm. The DirectX11 SDK OIT sample is pretty slow (a compute shader usage sample), but have read from numerous sources that the ATI OIT algorithm is pretty fast (it is), so I decided to try implementing it. Lots of people have already implemented ATI’s linked list OIT and have made public their implementations so I had a lot of good references for my simple implementation.
CodePlex link for my program’s source code and binary are provided at the end of the article.
ATI’s conference presentation list contains a link to their “GDC 2010: OIT and GI using DX11 linked lists” presentation ppt. This demo is an implementation of the algorithm described in this presentation.
GPU Pro contributor Kaori Kubota-san’s linked list OIT implementation. She walks through the linked list OIT implementation pretty carefully and her explanations are interspersed with source code. Couldn’t find sample code for stuff like D3D11_BUFFER_UAV_FLAG_COUNTER, so her explanations were very helpful. My implementation is based on the ATI presentation ppt and her blog posts.
A blog post about a linked-list OIT implementation. Good explanations.
A Japanese graphics programming website recently posted a linked list OIT implementation. Good explanations (in Japanese) with source code and binary.
Another linked list OIT implementation. Article is in Russian, so I used google translate to read it. Nice article with source code and binary provided. Learned about the implementation from the author’s blog post comment here http://www.wolfgang-engel.info/blogs/?p=116
Another Russian OIT implementation. Good explanations read using google translate again. Learned about the implementation from here http://www.geeks3d.com/forums/index.php/topic,861.0.html
The DX11 linked list technique can be used to speed up algorithms besides alpha blending. Toshiya Hachisuka-san’s “High-Quality Global Illumination Rendering Using Rasterization” algorithm can be sped up using ATI’s StructuredBuffer linked list technique.
A Screen Captures From My OIT Demo
Regular alpha blending using ID3D11BlendState. Notice that the far section of the blue quad is incorrectly rendered over the red quad. Since each colored quad is drawn in a single draw call, it’s not possible to sort the geometry to get correct alpha blending.
Rendered with the OIT algorithm. In the first pass, all pixel fragments are stored into a large StructuredBuffer. In the 2nd pass, the stored pixel fragments are read and sorted per-pixel inside a pixel shader program and everything is correctly rendered.
Other websites already explain the linked list OIT algorithm, so not going to do that in this blog post. On my ATI HD5750, with the DirectX SDK OIT sample, I get a fps of around 10 fps at a screen size of 320×240. With my ATI OIT implementation, I get a fps of around 700 fps at a screen size of 640×480. With regular ID3D11BlendState alpha blending, I get a fps around 3000 fps at a screen size of 640×480.
Source Code & Binary
It’s been over 3 months since my last demo. For the past month, I had been feeling somewhat down, but now I feel much better, so maybe I will be more productive. Not sure what I want to implement next. Maybe a translucent material demo based on this OIT demo. Or maybe experiment with DX11 tesselation and implement a DX11 Phong Tesselation demo.