RT god rays: use the RT shadow denoiser (adaptive history, anti-lag, SVGF/a-trous spatial, reactive) #657

Closed
opened 2026-10-11 02:22:43 +00:00 by sky_line · 2 comments
Owner

Ray-traced god rays (RenderVKGodRays > 0 with RenderVKSunShadows 2, the GODRAYS_RT march in clean_godrays.comp) trace one disc-jittered shadow ray per march step. They are only cleaned up by their own simple temporal pass (clean_godrays_temporal.comp, RenderVKGodRaysTemporal: camera reprojection plus a variance-clamped history). The ray-traced shadow mask has a much better denoiser (RenderVKRTShadowDenoise). Bring the god rays up to the same standard.

What the RT shadow denoiser has that god rays lack

  • Adaptive history length (RenderVKRTShadowHistory, up to 32 frames) instead of a fixed blend.
  • Moving-caster anti-lag (RenderVKRTShadowAntiLag / DynamicHistory). The trace flags texels whose rays hit a moving caster, and only there does the history reset fast. This matters for shafts cut by avatars, vehicles and swaying foliage.
  • Change detection that resets history only when the signal really changed, against a short running average (RenderVKRTShadowSvgf), not one noisy frame.
  • Edge-aware spatial filtering (RenderVKRTShadowAtrous a-trous / SVGF iterations, the RenderVKRTShadowSpatial penumbra blur), weighted by depth and variance.
  • Reactive mask for TAA/FSR where the shafts changed (RenderVKRTShadowReactive).

Notes

  • The god ray buffer is a view-space in-scatter integral, not a surface signal. The spatial weights should therefore key on the march's depth key (alpha = sample view distance), not the receiver's normal or plane. Variance should be estimated per texel at the march resolution.
  • Share code with the shadow denoiser where possible rather than forking it: the clamp, history and variance helpers, and the anti-lag flagging from the trace.
  • Goal: fewer steps per ray (cheaper RenderVKGodRays tiers) at the same or better stability, with no shimmer at shaft edges and no ghosting behind moving casters. Measure the cost with RenderVKGpuTimers (godray sub-marks) before and after.
  • Cascade (shadow-map) god rays could optionally use the same filter. They are noisy only through the dither, so this is lower priority.
Ray-traced god rays (`RenderVKGodRays` > 0 with `RenderVKSunShadows 2`, the `GODRAYS_RT` march in `clean_godrays.comp`) trace **one disc-jittered shadow ray per march step**. They are only cleaned up by their own simple temporal pass (`clean_godrays_temporal.comp`, `RenderVKGodRaysTemporal`: camera reprojection plus a variance-clamped history). The ray-traced shadow mask has a much better denoiser (`RenderVKRTShadowDenoise`). Bring the god rays up to the same standard. ## What the RT shadow denoiser has that god rays lack - **Adaptive history length** (`RenderVKRTShadowHistory`, up to 32 frames) instead of a fixed blend. - **Moving-caster anti-lag** (`RenderVKRTShadowAntiLag` / `DynamicHistory`). The trace flags texels whose rays hit a moving caster, and only there does the history reset fast. This matters for shafts cut by avatars, vehicles and swaying foliage. - **Change detection** that resets history only when the signal really changed, against a short running average (`RenderVKRTShadowSvgf`), not one noisy frame. - **Edge-aware spatial filtering** (`RenderVKRTShadowAtrous` a-trous / SVGF iterations, the `RenderVKRTShadowSpatial` penumbra blur), weighted by depth and variance. - **Reactive mask** for TAA/FSR where the shafts changed (`RenderVKRTShadowReactive`). ## Notes - The god ray buffer is a view-space in-scatter integral, not a surface signal. The spatial weights should therefore key on the march's depth key (alpha = sample view distance), not the receiver's normal or plane. Variance should be estimated per texel at the march resolution. - Share code with the shadow denoiser where possible rather than forking it: the clamp, history and variance helpers, and the anti-lag flagging from the trace. - Goal: fewer steps per ray (cheaper `RenderVKGodRays` tiers) at the same or better stability, with no shimmer at shaft edges and no ghosting behind moving casters. Measure the cost with `RenderVKGpuTimers` (godray sub-marks) before and after. - Cascade (shadow-map) god rays could optionally use the same filter. They are noisy only through the dither, so this is lower priority.
sky_line added this to the Slipstream project 2026-10-11 02:22:43 +00:00
Author
Owner

Agent dispatched (Opus).

Agent dispatched (Opus).
Author
Owner

Shipped in 1.3.0 Beta 3: ray-traced god rays use the RT shadow denoiser (RenderVKGodRaysDenoise; 0 = previous temporal pass).

Shipped in **1.3.0 Beta 3**: ray-traced god rays use the RT shadow denoiser (RenderVKGodRaysDenoise; 0 = previous temporal pass).
sky_line 2026-10-11 08:53:34 +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#657
No description provided.