CHAO BIAN / SELECTED WORKAll projects ↗

COMPUTER GRAPHICS / UNITY BUILT-IN · HLSL / CG

Screen-Space
Ambient OcclusionFrom noisy samples to clearer contact.

A rendering study in reconstructing scene geometry, estimating local occlusion, and preserving surface boundaries during filtering.

MY WORK
SSAO implementation & debugging
FOCUS
Depth, normals & multi-pass filtering
PROJECT TYPE
Implementation study
ENGINE
Unity 2022.3 · Built-in · Deferred

01 / FINAL RESULT

Grounding the scene.

Occlusion strengthens the contact beneath the bed and chair, along wall corners, and where the ceiling beams meet. Compare the same camera view with and without the effect.

Cabin interior without the custom SSAO effectSame cabin interior with guided SSAO appliedWith SSAONo AO
50% with SSAO

This is a post-process approximation: visibility modulates the full rendered image, including direct lighting and highlights, rather than only an isolated ambient-light term.

02 / IMPLEMENTATION

Depth to visibility.

  1. 01

    Input / reconstruct

    Reconstruct world-space positions from camera depth using the inverse view-projection matrix, and read normals in world space.

  2. 02

    Occlusion estimation

    Occlusion estimation output in the cabin scene

    Orient hemisphere samples around the surface normal and project them into screen space. Compare sample depths with the scene depth to estimate occlusion.

  3. 03

    Guided filtering

    Guided filtering output in the cabin scene

    Apply normal- and depth-guided bilateral filtering to raw AO with horizontal and vertical 7-tap passes, reducing blending across surface boundaries.

  4. 04

    Composition

    Cabin scene with SSAO composited onto scene color

    Apply filtered visibility to the rendered scene. Separate raw and filtered AO outputs support debugging and comparison.

The occlusion pass rejects background and off-screen samples, applies a depth bias, and attenuates contributions across large depth differences. Material and temporary render texture lifetimes are managed in the C# camera component.

03 / FILTERING STUDY

Smoothing noise.
Keeping the boundary.

Gaussian filtering blends nearby pixels based only on screen-space distance. Normal and depth guidance reduces the weights of samples from different surfaces, smoothing noise while better preserving boundaries such as the mirror frame.

Raw AO

Raw AO: close-up of the standing mirror and adjacent wall
Visible sampling noise.View full image ↗

Gaussian

Gaussian: close-up of the standing mirror and adjacent wall
Smoother, but the mirror silhouette becomes blurred.View full image ↗

Normal + depth guided

Normal + depth guided: close-up of the standing mirror and adjacent wall
Reduces noise while keeping the mirror frame more distinct.View full image ↗

30 samples · Full resolution · 7 taps/pass · 2 px spacing

Capture environment: Unity 2022.3.36f1 · Built-in Render Pipeline · Deferred rendering

All three crops show the same region at the same scale. Guidance improves edge preservation, while residual grain and low-frequency patches remain visible on broad surfaces.

04 / DEBUGGING & TAKEAWAYS

The filter footprint matters.

Matching horizontal and vertical sampling

The earlier pipeline filtered into a half-resolution texture before the vertical pass. Using that texture’s texel size doubled the vertical sample spacing relative to the horizontal pass.

I changed both intermediate textures to full resolution, giving the two directions a consistent pixel footprint.

Building this effect connected depth reconstruction, hemisphere sampling, and filtering into a working screen-space pipeline. Comparing Gaussian and geometry-guided filtering helped me understand how smoothing changes both noise and surface boundaries.