[Epic] Ray-traced global illumination #87

Open
opened 2026-09-27 05:44:58 +00:00 by sky_line · 2 comments
Owner

Goal: dynamic diffuse global illumination (bounce light) on RT-capable GPUs.

Approach options (pick after a spike)

  1. Probe-based (DDGI-style) - recommended first. Camera-following cascaded irradiance-probe grid; each frame a budgeted subset of probes traces N rays against the TLAS, shades hits with sun/sky/local lights (+ previous-frame probe irradiance for multi-bounce), stores irradiance + distance moments (Chebyshev visibility). Lit pass samples probes for indirect diffuse. Stable, low noise, no heavy per-pixel denoising, scales well to large SL scenes, amortizable.
  2. Screen-space ReSTIR GI. Higher fidelity, much heavier denoising dependence; revisit after TAA + denoiser mature.

Interplay

  • SL already has reflection probes (our VK probe path handles specular); GI replaces/augments the diffuse ambient term. Needs a clear blend with probe ambient and SL's environment ambient to avoid double counting.
  • Hit shading needs a material/texture lookup at hit points (albedo from the RT material table - the alpha-test code already samples textures).

Children

  1. Spike: probe grid prototype (static cascade, sun only) + debug visualisation.
  2. Probe update pass (budgeted rays, hit shading incl. local lights, multi-bounce).
  3. Lit-pass sampling + blend with probe ambient.
  4. Cascades + camera scrolling + teleport invalidation.
  5. Settings/quality tiers + GPU timers.

Size: L. Depends on: RT foundation (done), benefits from temporal epic. Risk: light leaking through thin SL walls (mitigate with Chebyshev visibility + probe relocation), cost in dense sims.

Acceptance: enclosed spaces

  • A sealed room goes dark. A fully enclosed box/room with no openings and no lights inside renders black (apart from its own local lights and emissive surfaces, #91 tier 1). Indoor sky ambient comes only from GI rays that escape to the sky.
  • GI replaces the ambient floor, it doesn't add to it. With GI on, SL's flat environment ambient is not added on top. A minimum ambient setting (default 0 with GI on) keeps sealed builds navigable for people who want a floor.
  • Reflections are occluded too. Specular must not leak the sky into a sealed room: probe0 (the always-selected sky baseline) and other outside probes get occlusion from the GI visibility data, or interior probes fully take over inside an enclosure.
  • Thin walls and small rooms. SL walls are often 1-10 cm and a small sealed box can be smaller than the probe spacing (every surrounding probe outside, all rejected by Chebyshev visibility). Must handle it: finer near-camera cascade, probe relocation out of walls/geometry, and/or per-pixel short-range rays for the near field (option 2's screen-space ReSTIR GI as the near-field term).
  • Test cases: 10 m sealed room; 2 m sealed box (smaller than the probe spacing); 1 cm-thick walls; the same room with a door (light enters only through the opening); a sealed room with one lamp. Each checked for diffuse and specular leaks, with GPU timers.
**Goal:** dynamic diffuse global illumination (bounce light) on RT-capable GPUs. ### Approach options (pick after a spike) 1. **Probe-based (DDGI-style) - recommended first.** Camera-following cascaded irradiance-probe grid; each frame a budgeted subset of probes traces N rays against the TLAS, shades hits with sun/sky/local lights (+ previous-frame probe irradiance for multi-bounce), stores irradiance + distance moments (Chebyshev visibility). Lit pass samples probes for indirect diffuse. Stable, low noise, no heavy per-pixel denoising, scales well to large SL scenes, amortizable. 2. **Screen-space ReSTIR GI.** Higher fidelity, much heavier denoising dependence; revisit after TAA + denoiser mature. ### Interplay - SL already has reflection probes (our VK probe path handles specular); GI replaces/augments the *diffuse* ambient term. Needs a clear blend with probe ambient and SL's environment ambient to avoid double counting. - Hit shading needs a material/texture lookup at hit points (albedo from the RT material table - the alpha-test code already samples textures). ### Children 1. Spike: probe grid prototype (static cascade, sun only) + debug visualisation. 2. Probe update pass (budgeted rays, hit shading incl. local lights, multi-bounce). 3. Lit-pass sampling + blend with probe ambient. 4. Cascades + camera scrolling + teleport invalidation. 5. Settings/quality tiers + GPU timers. **Size:** L. **Depends on:** RT foundation (done), benefits from temporal epic. **Risk:** light leaking through thin SL walls (mitigate with Chebyshev visibility + probe relocation), cost in dense sims. ### Acceptance: enclosed spaces - **A sealed room goes dark.** A fully enclosed box/room with no openings and no lights inside renders black (apart from its own local lights and emissive surfaces, #91 tier 1). Indoor sky ambient comes only from GI rays that escape to the sky. - **GI replaces the ambient floor, it doesn't add to it.** With GI on, SL's flat environment ambient is not added on top. A **minimum ambient** setting (default 0 with GI on) keeps sealed builds navigable for people who want a floor. - **Reflections are occluded too.** Specular must not leak the sky into a sealed room: probe0 (the always-selected sky baseline) and other outside probes get occlusion from the GI visibility data, or interior probes fully take over inside an enclosure. - **Thin walls and small rooms.** SL walls are often 1-10 cm and a small sealed box can be smaller than the probe spacing (every surrounding probe outside, all rejected by Chebyshev visibility). Must handle it: finer near-camera cascade, probe relocation out of walls/geometry, and/or per-pixel short-range rays for the near field (option 2's screen-space ReSTIR GI as the near-field term). - **Test cases:** 10 m sealed room; 2 m sealed box (smaller than the probe spacing); 1 cm-thick walls; the same room with a door (light enters only through the opening); a sealed room with one lamp. Each checked for diffuse and specular leaks, with GPU timers.
Author
Owner

Scope note: GI hit shading must include emissive radiance (PBR emissive + legacy fullbright/glow mapping) so emissive surfaces contribute soft bounce light. Sharp emissive area lighting is tracked separately in #91.

Scope note: GI hit shading must include emissive radiance (PBR emissive + legacy fullbright/glow mapping) so emissive surfaces contribute soft bounce light. Sharp emissive area lighting is tracked separately in #91.
sky_line added this to the Slipstream project 2026-10-06 15:04:15 +00:00
Author
Owner

Child ticket: #869 ReSTIR DI (shadowed direct lighting from all local lights / projectors / emissive). Also supplies hit lighting for GI rays (world light grid + RIS) instead of looping all lights at hit points.

Child ticket: #869 ReSTIR DI (shadowed direct lighting from all local lights / projectors / emissive). Also supplies hit lighting for GI rays (world light grid + RIS) instead of looping all lights at hit points.
Sign in to join this conversation.
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#87
No description provided.