Implementing order-independent transparency
Until now, we’ve rendered transparent objects using a basic punch-through transparency method, as described in the Rendering large scenes recipe from Chapter 8. While this approach was limited in quality, it allowed transparent and opaque objects to be rendered together without any additional care or sorting, greatly simplifying the rendering pipeline. Now, let’s take it a step further and implement a method that enables correctly blended transparent objects.
Alpha blending of multiple surfaces requires sorting all transparent surfaces back-to-front, which can be achieved through various methods. These include sorting scene objects back-to-front, using multi-pass depth peeling techniques, as described in https://matthewwellings.com/blog/depth-peeling-order-independent-transparency-in-vulkan, and employing order-independent approximations such as http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent...