Short Range AO with Bent Normal

Although the pass is named "ShortRangeAO_ScreenSpace", it actually calculates Bent Normal.

Theory

What is Bent Normal(s)

https://graphics.tudelft.nl/Publications-new/2012/KRES12/paper.pdf
While AO stores an average occlusion, bent normals are modified normals bent according to an estimate of the direction that is most unobstructed, i. e., the average unblocked direction.

If readers are not familiar with the definition of Bent Normal, I highly recommend reading the following two resources to get more information.

Reason

About why to use Bent Normal to additionally apply Short Range AO here, there is an explanation in Lumen's official introduction video.

In short, because the basic unit of Tracing used before was Screen Space Probe, not screen pixels, high-frequency details will be lost. As shown in the figure, Contact Shadows in the gaps are missing.

image

To reconstruct such high-frequency details and enhance the amount of information in the details, it is necessary to perform a Bent Normal AO at the screen pixel resolution.

image

The following comparison shows the effect of Bent Normal:

image

Processing

image

The calculation process of this part is not complicated. Each thread is responsible for processing one pixel on the screen.

  • Starting from each pixel, emit 4 screen space trace rays.
  • Determine if the ray hits anything.
  • If it does not hit anything, consider it as unoccluded (green ray).
  • Calculate the average of all unoccluded rays, which is the Bent Normal direction.
  • Store it in the output buffer.