← All projects
Render pass 03 — shading2026

Outline Shader

A post-process outline shader driven by depth and normal edge detection.

  • Unreal Engine 5
  • Material Graph

Approach

Depth discontinuities catch silhouette edges — where an object’s edge meets background or another object at a different distance. That part is straightforward: any forward renderer exposes a depth buffer.

Normals were the hard part. UE5’s forward shading path doesn’t write out a full normal buffer the way the deferred path does, so there’s nothing to sample directly for edges caused by an object folding away from the camera (e.g. a hard crease on an otherwise flat-looking surface) rather than by depth alone. The fix was to approximate surface normals in screen space instead of relying on a G-buffer that doesn’t exist in this pipeline — reconstructing them well enough from the depth buffer itself to catch normal-based edges alongside the depth-based ones.