This is an implementation of order-independent transparency in Unity's render pipelines. Order-independent transparency allows blending transparent objects correctly according to their actual depth in the scene. This is a huge improvement compared to traditional blending of transparent objects in the realtime graphics pipeline. The implementation uses Per-Pixel Linked Lists, implemented with RWStructuredBuffers. These are features requiring Shader Model 5.0 with ComputeBuffers, see the Unity Manual for supported platforms. Further technical information and resources are listed in the references section.
You can easily install this package with the Unity Package Manager using the project's git url. You can look at Unity's guide for detailed instructions.
For every implementation, a sample scene is included and available for import with the Unity Package Manager. If in doubt, try to import the sample you want to use and start from there.
Setup the rendering implementation for your chosen pipeline:
OitRenderPass
to it.Order Independent Transparency Renderer
to your Universal Renderer Asset. Order Independent Transparency
to a post-processing volume in your scene.Change the material of every object that shall be rendered with order-independent transparency. They have to be rendered with a shader writing to the buffer used by the order-independent transparency implementation. Sample shaders that you can use are included in this project: OrderIndependentTransparency/Unlit
for all pipelines, OrderIndependentTransparency/Standard
for the built-in pipeline, OrderIndependentTransparency/URP/Lit
for the Universal Render Pipeline and OrderIndependentTransparency/HDRP/Lit
for the High-Definition Render Pipeline.
Run your scene.
Platform | Graphics Backend | Render output |
---|---|---|
Windows | DirectX 12 | :white_check_mark: |
DirectX 11 | :white_check_mark: | |
Vulkan | :white_check_mark: | |
OpenGLCore | :ok: (poor performance) | |
OpenGLES3 | :x: (editor crashes) | |
Linux | Vulkan | :white_check_mark: |
OpenGLCore | :ok: (poor performance) | |
Mac | Metal | :question: |
OpenGLCore | :question: | |
iOS | Metal | :question: |
Android | Vulkan | :white_check_mark: |
OpenGLES3 | :ok: (render artifacts) | |
WebGPU | - | :crystal_ball: |
WebGL | - | :x: |