Rez effects as separate pipeline variants: zero cost when no object is rezzing #1294

Open
opened 2026-10-29 15:44:48 +00:00 by sky_line · 1 comment
Owner

Rez effects (CombatFX #1211 / #1271, gmdx_rezfx.glsl) are compiled into every world draw and pre-pass shader (clean_draw.vert/.frag, clean_draw_rigged.vert, clean_cluster_draw.mesh, clean_prepass_{normal,motion,blend,mask}.frag, clean_pick.frag), so every world pixel pays for them in shader size, compile time and registers, even with no object rezzing. Suspected in a 1.5.0 Beta 5 report from an AMD 9070 XT on Windows: a 31-minute shader compile, a blue void, and lower FPS.

Goal: with no rez effect active, rez effects cost nothing.

  • Main world shaders contain no rez code at all (compiled without it).
  • Rezzing instances are routed by the GPU cull into their own small indirect draw list(s), drawn with rez pipeline variants. Instances move between lists on the GPU when their rez flags change (no CPU per-object management).
  • Rez variants compile lazily or at low priority, so they never block the world from drawing.
  • Shadows, the mask pre-pass, picking and cluster LOD paths all follow the same routing.
  • Fixed cost; bounded list sizes; no new persistent settings.

Acceptance: world shader SPIR-V size and pipeline compile time measurably smaller than with the rez code included; identical images with rez effects off; rez in/out effects unchanged when on.

Rez effects (CombatFX #1211 / #1271, `gmdx_rezfx.glsl`) are compiled into every world draw and pre-pass shader (`clean_draw.vert/.frag`, `clean_draw_rigged.vert`, `clean_cluster_draw.mesh`, `clean_prepass_{normal,motion,blend,mask}.frag`, `clean_pick.frag`), so every world pixel pays for them in shader size, compile time and registers, even with no object rezzing. Suspected in a 1.5.0 Beta 5 report from an AMD 9070 XT on Windows: a 31-minute shader compile, a blue void, and lower FPS. **Goal:** with no rez effect active, rez effects cost nothing. - Main world shaders contain no rez code at all (compiled without it). - Rezzing instances are routed by the GPU cull into their own small indirect draw list(s), drawn with rez pipeline variants. Instances move between lists on the GPU when their rez flags change (no CPU per-object management). - Rez variants compile lazily or at low priority, so they never block the world from drawing. - Shadows, the mask pre-pass, picking and cluster LOD paths all follow the same routing. - Fixed cost; bounded list sizes; no new persistent settings. **Acceptance:** world shader SPIR-V size and pipeline compile time measurably smaller than with the rez code included; identical images with rez effects off; rez in/out effects unchanged when on.
sky_line added this to the Slipstream project 2026-10-29 15:44:48 +00:00
Author
Owner

Implemented on branch 1294-rezfx-split (09f711d42c, afda34fccf; on the test branch as bdc9f4d48d / 63304d8967). Accepted for now; known limitations to investigate one by one later:

  1. Cluster-LOD objects get no rez-in / de-rez fade.
  2. Mirrors and reflection probes show a de-rezzing object whole until it is released.
  3. Rigged alpha surfaces (hair etc.) get no effect.
  4. While any row of a solid rigged bucket is rezzing in view, the whole bucket draws with the rez shader for that frame.
  5. The static alpha rez list draws after the post-water alpha and is not sorted.
  6. Objects building in with the hidden effects (3D printer, transporter) cannot be clicked until they finish.
  7. No rez effects in VR stereo or in overdraw-atomic frames.
  8. The terminator-triangle and avatar-id passes skip rez rows.
  9. Right after login with the default Tron effect, objects rez in without it until the rez variants finish compiling in the background.

Measured shader sizes (SPIR-V bytes): world vertex shaders 42-64% smaller, pre-pass FS 67-84%, G-buffer FS ~30%; the forward lit FS only ~5% (it is ~2.5 MB itself). Design note: agents/1294_rezfx_split.md (local).

**Implemented on branch `1294-rezfx-split` (09f711d42c, afda34fccf; on the test branch as bdc9f4d48d / 63304d8967). Accepted for now; known limitations to investigate one by one later:** 1. Cluster-LOD objects get no rez-in / de-rez fade. 2. Mirrors and reflection probes show a de-rezzing object whole until it is released. 3. Rigged alpha surfaces (hair etc.) get no effect. 4. While any row of a solid rigged bucket is rezzing in view, the whole bucket draws with the rez shader for that frame. 5. The static alpha rez list draws after the post-water alpha and is not sorted. 6. Objects building in with the hidden effects (3D printer, transporter) cannot be clicked until they finish. 7. No rez effects in VR stereo or in overdraw-atomic frames. 8. The terminator-triangle and avatar-id passes skip rez rows. 9. Right after login with the default Tron effect, objects rez in without it until the rez variants finish compiling in the background. Measured shader sizes (SPIR-V bytes): world vertex shaders 42-64% smaller, pre-pass FS 67-84%, G-buffer FS ~30%; the forward lit FS only ~5% (it is ~2.5 MB itself). Design note: agents/1294_rezfx_split.md (local).
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#1294
No description provided.