Depth Peeling
- A way to implement Front to Back Alpha Blending using a Graphics Pipeline .
How it works #
Render the whole scene in multiple rendering passes. As many rendering passes as Depth Complexity .
-
Render normal scene with standard depth test and store frame in RGBA texture
-
In the
renderpass, render only the
nearest fragments

Figure 1: The camera ist left looking right
-
At the end use the Alpha Blending computation to composite all the render targets together.
Determining if a fragment is eligible for the next closest layer #
Use two depth buffers, 2 depth tests per render pass.
- Use the depth buffer from the last render pass, and discard every fragment that is closer than the last render pass.
- Write all fragments in the current depth buffer and do normal depth buffering for all fragments that pass the first depth test.
- Between render passes swap the buffers (“Ping-Pong Texture”).
Evaluation #
Con:
- As many rendering passes as Depth Complexity