Depth Peeling

Depth Peeling

How it works #

Render the whole scene in multiple rendering passes. As many rendering passes as Depth Complexity .

  1. Render normal scene with standard depth test and store frame in RGBA texture

  2. In the depth_peeling_b1e96ba29222751b88484ef7bb9fae606c254b9a.svg renderpass, render only the depth_peeling_b1e96ba29222751b88484ef7bb9fae606c254b9a.svg nearest fragments

    Figure 1: The camera ist left looking right

    Figure 1: The camera ist left looking right

  3. 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.

  1. Use the depth buffer from the last render pass, and discard every fragment that is closer than the last render pass.
  2. Write all fragments in the current depth buffer and do normal depth buffering for all fragments that pass the first depth test.
  3. Between render passes swap the buffers (“Ping-Pong Texture”).

Evaluation #

Con:

Calendar October 22, 2023