Avatar visibility per pass (main / shadow / projector / probe / mirror), GPU-decided probe avatar visibility, skip off-screen probes #517

Closed
opened 2026-10-07 05:02:16 +00:00 by sky_line · 1 comment
Owner

Found while testing #479's frozen culling camera: with the cull camera frozen and pointed away, a group of 5 avatars kept rendering. Turning shadows off didn't help; setting reflections to static-only did.

Causes

  1. One visibility bit per avatar for every pass. av_vis (LLCleanRendererVK, ~llcleanrenderervk.cpp:6040-6160) is set if the avatar is in the main frustum, OR its sun-shadow sweep touches it, OR it's inside a shadowed projector's cone, OR a mirror sees it, OR it's near a dynamic probe. Rigged mesh skips the GPU frustum test and relies on this bit, so an avatar kept only for a shadow/projector/probe/mirror pass is also fully skinned and drawn in the main view, even behind the camera. In a club with spotlights, every avatar in a cone renders in the main pass.
  2. Dynamic-probe rule is far too broad (added by #478, ~line 6121): an avatar within RenderReflectionProbeDrawDistance (64 m) of any dynamic manual probe stays visible, and it fires at probe detail 1 (wf.probe_detail >= 1, ~line 8584) although realtime captures only run at detail 2+.
  3. Off-screen probes still capture. Probes whose influence volume is entirely outside the view keep getting scheduled / realtime-captured.

Fix

  1. Per-pass avatar visibility. Main-view visibility comes only from the cull frustum (+ the 16 m near radius). Separate bits for sun shadow, projector shadow, probe capture and mirror; each pass draws an avatar only if its own bit is set, and the main pass skips avatars visible only to other passes. Extends the existing kAvVisNoShadow / per-pass bucket pattern.
  2. Probe avatar visibility decided on the GPU, for the probe actually scheduled. Only at detail >= 2, and only for this frame's realtime job: the GPU job (#478) already knows the probe's origin and far clip, so the probe pass tests avatar boxes (already uploaded in av_vis's box area) against that, instead of the CPU guessing with "any dynamic probe".
  3. Skip probes entirely off screen. A probe whose influence volume (sphere/box) doesn't intersect the cull frustum gets no scheduled or realtime capture. When it comes back on screen it's stale, so it gets a high-priority refresh (the #478 "dirty" boost) and is current again within a frame or two. The default (sky) probe is exempt.

Done when

  • Frozen camera pointed away from a group: no main-view draws for them with shadows, projectors, mirrors and dynamic probes all on (check avFull / avReduced and the main-pass rigged counts).
  • Shadows, projector shadows, mirrors and realtime probe captures still show avatars correctly.
  • Probe capture count drops when probes are off screen; turning to face one refreshes it promptly with no visible stale flash beyond a frame or two.
  • Crowd + spotlights: main-pass rigged work falls for off-screen avatars.
Found while testing #479's frozen culling camera: with the cull camera frozen and pointed away, a group of 5 avatars kept rendering. Turning shadows off didn't help; setting reflections to static-only did. ## Causes 1. **One visibility bit per avatar for every pass.** `av_vis` (`LLCleanRendererVK`, ~`llcleanrenderervk.cpp:6040-6160`) is set if the avatar is in the main frustum, OR its sun-shadow sweep touches it, OR it's inside a shadowed projector's cone, OR a mirror sees it, OR it's near a dynamic probe. Rigged mesh skips the GPU frustum test and relies on this bit, so an avatar kept only for a shadow/projector/probe/mirror pass is also fully skinned and **drawn in the main view**, even behind the camera. In a club with spotlights, every avatar in a cone renders in the main pass. 2. **Dynamic-probe rule is far too broad** (added by #478, ~line 6121): an avatar within `RenderReflectionProbeDrawDistance` (64 m) of **any** dynamic manual probe stays visible, and it fires at probe detail **1** (`wf.probe_detail >= 1`, ~line 8584) although realtime captures only run at detail 2+. 3. **Off-screen probes still capture.** Probes whose influence volume is entirely outside the view keep getting scheduled / realtime-captured. ## Fix 1. **Per-pass avatar visibility.** Main-view visibility comes only from the cull frustum (+ the 16 m near radius). Separate bits for sun shadow, projector shadow, probe capture and mirror; each pass draws an avatar only if its own bit is set, and the main pass skips avatars visible only to other passes. Extends the existing `kAvVisNoShadow` / per-pass bucket pattern. 2. **Probe avatar visibility decided on the GPU, for the probe actually scheduled.** Only at detail >= 2, and only for this frame's realtime job: the GPU job (#478) already knows the probe's origin and far clip, so the probe pass tests avatar boxes (already uploaded in `av_vis`'s box area) against that, instead of the CPU guessing with "any dynamic probe". 3. **Skip probes entirely off screen.** A probe whose influence volume (sphere/box) doesn't intersect the cull frustum gets no scheduled or realtime capture. When it comes back on screen it's stale, so it gets a high-priority refresh (the #478 "dirty" boost) and is current again within a frame or two. The default (sky) probe is exempt. ## Done when - Frozen camera pointed away from a group: no main-view draws for them with shadows, projectors, mirrors and dynamic probes all on (check `avFull` / `avReduced` and the main-pass rigged counts). - Shadows, projector shadows, mirrors and realtime probe captures still show avatars correctly. - Probe capture count drops when probes are off screen; turning to face one refreshes it promptly with no visible stale flash beyond a frame or two. - Crowd + spotlights: main-pass rigged work falls for off-screen avatars.
sky_line added this to the Slipstream project 2026-10-07 05:02:16 +00:00
Author
Owner

Shipped in 1.1.0 Beta 9 (v1.1.0-beta.9).

Shipped in 1.1.0 Beta 9 (v1.1.0-beta.9).
sky_line 2026-10-07 07:27:54 +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#517
No description provided.