Implementing order-independent transparency
So far, we've rendered transparent objects using a very simple punch-through transparency method, as described in the Implementing a material system recipe of Chapter 7, Graphics Rendering Pipeline. This approach was very limited in terms of quality, but it allowed us to render transparent objects together with opaque objects, which greatly simplified the entire rendering pipeline. Let's push this thing a bit further and implement another approach that allows correctly blended transparent objects.
Alpha blending multiple surfaces is an operation that requires all transparent surfaces to be sorted back to front. There are multiple ways to do this, such as sorting scene objects back to front, using multiple pass depth peeling techniques (https://matthewwellings.com/blog/depth-peeling-order-independent-transparency-in-vulkan), making order-independent approximations (http://casual-effects.blogspot.com/2014/03/weighted-blended-order...