RT shadows: full-resolution edge refinement for reduced-resolution shadow masks #768

Open
opened 2026-10-15 00:20:58 +00:00 by sky_line · 0 comments
Owner

With RT shadow resolution below full (Preferences > Graphics > Advanced > RT shadow resolution, RenderVKRTShadowMaskScale), shadow edges are quantized to the mask grid: at half resolution each traced texel covers 2x2 screen pixels. The depth-aware bilinear upsample (clean_shadow_mask_read.glsl) keeps shadows from bleeding across silhouettes but can't add edge detail that wasn't traced, so edges show a soft staircase. It gets worse as you zoom out: an avatar's shadow shrinks to a handful of mask texels while the texel stays 2x2 px. Full resolution doesn't show it.

Proposal: full-resolution edge refinement

  1. Trace the mask at the reduced resolution as today.
  2. Find edge / penumbra texels (the 2x2 neighbourhood disagrees, per light: sun/moon and each RT projector).
  3. Re-trace only the full-resolution pixels under those texels; the upsample uses the refined results there.

Uniformly lit / shadowed areas keep the reduced-resolution cost; edges come out exact at any distance. Extra cost scales with edge pixels (typically a few % of the screen).

Notes

  • Possibly a new option (e.g. "Half + full-res edges") alongside the existing resolution choices, so the plain reduced modes stay available.
  • Must work with the shadow denoiser (temporal history / spatial filter run at mask resolution) and the projector layers.
  • Indirect dispatch over a compacted edge-pixel list (GPU-driven; no CPU readback).
  • Considered: checkerboard (jittered half-res + temporal reconstruction) -- matches full res when static but smears in motion and interacts with TAA/FSR; edge refinement preferred.
With RT shadow resolution below full (Preferences > Graphics > Advanced > RT shadow resolution, `RenderVKRTShadowMaskScale`), shadow edges are quantized to the mask grid: at half resolution each traced texel covers 2x2 screen pixels. The depth-aware bilinear upsample (`clean_shadow_mask_read.glsl`) keeps shadows from bleeding across silhouettes but can't add edge detail that wasn't traced, so edges show a soft staircase. It gets worse as you zoom out: an avatar's shadow shrinks to a handful of mask texels while the texel stays 2x2 px. Full resolution doesn't show it. ## Proposal: full-resolution edge refinement 1. Trace the mask at the reduced resolution as today. 2. Find edge / penumbra texels (the 2x2 neighbourhood disagrees, per light: sun/moon and each RT projector). 3. Re-trace only the full-resolution pixels under those texels; the upsample uses the refined results there. Uniformly lit / shadowed areas keep the reduced-resolution cost; edges come out exact at any distance. Extra cost scales with edge pixels (typically a few % of the screen). ## Notes - Possibly a new option (e.g. "Half + full-res edges") alongside the existing resolution choices, so the plain reduced modes stay available. - Must work with the shadow denoiser (temporal history / spatial filter run at mask resolution) and the projector layers. - Indirect dispatch over a compacted edge-pixel list (GPU-driven; no CPU readback). - Considered: checkerboard (jittered half-res + temporal reconstruction) -- matches full res when static but smears in motion and interacts with TAA/FSR; edge refinement preferred.
sky_line added this to the Slipstream project 2026-10-15 00:20:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#768
No description provided.