Perf: time-slice reflection probe capture (~3.5 ms/frame) #124

Closed
opened 2026-09-27 18:33:25 +00:00 by sky_line · 1 comment
Owner

GTX 1080 Ti @ 1918×1008, RenderVKGpuTimers (see #98): probe is 3.4–4.2 ms every frame. At ProbeDetail=2 a full 6-face probe is re-captured every frame. It's the biggest fixed GPU cost on the RTX 5090 as well (1.7 ms of ~7).

  • Capture one face per frame, round-robin (LL's approach), or spread probes over N frames.
  • Re-capture sooner only when the probe's contents or the sun change.
  • Longer term: a single-pass layered 6-face render (see the phase P notes).

Part of #98.

GTX 1080 Ti @ 1918×1008, `RenderVKGpuTimers` (see #98): `probe` is 3.4–4.2 ms every frame. At `ProbeDetail=2` a full 6-face probe is re-captured every frame. It's the biggest fixed GPU cost on the RTX 5090 as well (1.7 ms of ~7). - Capture one face per frame, round-robin (LL's approach), or spread probes over N frames. - Re-capture sooner only when the probe's contents or the sun change. - Longer term: a single-pass layered 6-face render (see the phase P notes). Part of #98.
Author
Owner

Fixed in 0dd5eab9a0. The ticket's premise was already done (one face per frame, round-robin); the remaining cost was found with per-capture pipeline statistics + timestamps:

  1. Terrain bounds -- every terrain patch had a region-sized placeholder AABB, so it passed every frustum (main view, shadows, mirror, probes). A downward probe face drew two whole regions (262k of its 307k tris). Patches now carry real bounds; terrain is exempt from the origin override.
  2. Capture resolution -- faces were captured at 2x the radiance res (1024^2 at ProbeResolution 512). Now 1:1.
  3. Probe cull -- LOD/texture demand from the face's pixel density; sub-2-px objects skipped (RenderVKProbeMinPixels).
  4. Front-to-back sort of opaque + mask per face.
  5. Alpha-mask depth pre-pass in probe faces, lit FS at depth EQUAL (RenderVKProbeMaskPrepass) -- one probe sat over ~20 layers of see-through cutouts (23.5M mask FS invocations -> 0.25M).

Same spot: probe 2.6-4.3 -> 0.75-0.91 ms/frame; worst face 26-28 -> 2.5-3.2 ms; worst frame 29-38 -> 14 ms; frame avg 13.6-14.9 -> 12.0 ms.

Still open as separate ideas: single-pass layered 6-face capture.

Fixed in 0dd5eab9a0. The ticket's premise was already done (one face per frame, round-robin); the remaining cost was found with per-capture pipeline statistics + timestamps: 1. **Terrain bounds** -- every terrain patch had a region-sized placeholder AABB, so it passed every frustum (main view, shadows, mirror, probes). A downward probe face drew two whole regions (262k of its 307k tris). Patches now carry real bounds; terrain is exempt from the origin override. 2. **Capture resolution** -- faces were captured at 2x the radiance res (1024^2 at ProbeResolution 512). Now 1:1. 3. **Probe cull** -- LOD/texture demand from the face's pixel density; sub-2-px objects skipped (`RenderVKProbeMinPixels`). 4. **Front-to-back sort** of opaque + mask per face. 5. **Alpha-mask depth pre-pass** in probe faces, lit FS at depth EQUAL (`RenderVKProbeMaskPrepass`) -- one probe sat over ~20 layers of see-through cutouts (23.5M mask FS invocations -> 0.25M). Same spot: probe 2.6-4.3 -> 0.75-0.91 ms/frame; worst face 26-28 -> 2.5-3.2 ms; worst frame 29-38 -> 14 ms; frame avg 13.6-14.9 -> 12.0 ms. Still open as separate ideas: single-pass layered 6-face capture.
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#124
No description provided.