Weighted Blended OIT Sample
Description
Weighted Blended OIT Sample demonstrates how plausible OIT (Order Independent Transparency) can be rendered in a single geometry pass without any depth sorting, as described in McGuire and Bavoil 2013. The idea is to use additive blending to compute a weighted average of the translucent colors with a weighting function that falls off as the linear depth increases. This sample compares the quality and performance of Weighted Blended OIT with Depth Peeling.
APIs Used
- OpenGL 4.0
Shared User Interface
The Graphics samples all share a common app framework and certain user interface elements, centered around the "Tweakbar" panel on the left side of the screen which lets you interactively control certain variables in each sample.
To show and hide the Tweakbar, simply click or touch the triangular button positioned in the top-left of the view.
Technical Details
This sample is an implementation of the Weighted Blended OIT (Order Independent Transparency) algorithm from this research paper:
McGuire and Bavoil, Weighted Blended Order-Independent Transparency, Journal of Computer Graphics Techniques (JCGT), vol. 2, no. 2, 122--141, 2013.
Implementation
This SDK sample has two rendering methods for order-independent transparency:
- Depth peeling is performing one geometry pass per peeled layer until there are no more fragments to be peeled. The layers are blended as they are peeled, in front-to-back order.
-
Weighted Blended OIT is a fast approximation of the depth peeling result, in a single geometry pass. In this geometry pass, the fragments are blended into a Frame Buffer Object with 2 draw buffers.
In the first draw buffer (with format RGBA16F),
-
RGB
storesSum[FragColor.rgb * FragColor.a * Weight(FragDepth)]
-
Alpha
storesSum[FragColor.a * Weight(FragDepth)]
In the second draw buffer (with format R8),
R
storesProduct[1.0 - FragColor.a]
-
See Also
- [McGuire and Bavoil 2013] Morgan McGuire and Louis Bavoil. 'Weighted Blended Order-Independent Transparency'. Journal of Computer Graphics Techniques (JCGT), vol. 2, no. 2, 122--141, 2013.
- [Bavoil and Myers 2008] Louis Bavoil and Kevin Myers. 'Order Independent Transparency with Dual Depth Peeling'. NVIDIA Whitepaper. 2008.