mirror of
https://github.com/bevyengine/bevy
synced 2024-12-24 03:53:06 +00:00
4bf647ff3b
# Objective - Alpha blending can easily fail in many situations and requires sorting on the cpu ## Solution - Implement order independent transparency (OIT) as an alternative to alpha blending - The implementation uses 2 passes - The first pass records all the fragments colors and position to a buffer that is the size of N layers * the render target resolution. - The second pass sorts the fragments, blends them and draws them to the screen. It also currently does manual depth testing because early-z fails in too many cases in the first pass. ## Testing - We've been using this implementation at foresight in production for many months now and we haven't had any issues related to OIT. --- ## Showcase ![image](https://github.com/user-attachments/assets/157f3e32-adaf-4782-b25b-c10313b9bc43) ![image](https://github.com/user-attachments/assets/bef23258-0c22-4b67-a0b8-48a9f571c44f) ## Future work - Add an example showing how to use OIT for a custom material - Next step would be to implement a per-pixel linked list to reduce memory use - I'd also like to investigate using a BinnedRenderPhase instead of a SortedRenderPhase. If it works, it would make the transparent pass significantly faster. --------- Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com> Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com> Co-authored-by: Charlotte McElwain <charlotte.c.mcelwain@gmail.com> |
||
---|---|---|
.. | ||
cluster | ||
deferred | ||
light | ||
light_probe | ||
lightmap | ||
meshlet | ||
prepass | ||
render | ||
ssao | ||
ssr | ||
volumetric_fog | ||
bundle.rs | ||
extended_material.rs | ||
fog.rs | ||
lib.rs | ||
material.rs | ||
mesh_material.rs | ||
parallax.rs | ||
pbr_material.rs | ||
wireframe.rs |