Flickering shadows, stars and more at high altitude (Z ~3000): precision -- make it camera-relative #555

Closed
opened 2026-10-08 08:47:00 +00:00 by sky_line · 2 comments
Owner

User report (via the owner): at about 3000 m altitude (Z = 3000; skyboxes are commonly built there), the user sees flickering in:

  • shadow maps;
  • stars;
  • "some other things".

Likely cause: precision. Something is computed in region or world space with 32-bit floats when it should be camera-relative: transforms, light/shadow matrices, sky dome/star positions, or depth reconstruction. At Z of about 3000, float32 resolution is about 0.24 mm in position, but errors compound once positions get multiplied through view-projection matrices built in world space. They're also amplified by:

  • shadow-cascade texel snapping;
  • view-space depth reconstruction;
  • TAA reprojection;
  • RT ray origins.

Investigate (GPU-driven VK pipeline):

  • how model/view/projection are built (camera-relative rendering, or world-space MVP);
  • shadow cascade fitting and stabilisation (texel snapping in world vs light space);
  • the sky/stars/moon/clouds draw (dome centred on the camera? star positions far away in float?);
  • depth-to-position reconstruction in deferred lighting, SSR, AO and god rays;
  • reflection probes;
  • TAA / motion vectors (previous-frame matrices);
  • RT TLAS instance transforms and ray origins;
  • water and terrain at altitude (water plane far below).

Repro: rez a platform at Z 3000 (or teleport to a skybox), stand still, enable sun shadows, watch shadows and stars. Compare with the same scene at Z 30.

Done when: no flicker or shimmer at Z 3000 (also check 4000+, up to the 4096 build limit, and higher where avatars can fly), and nothing changes near the ground.

**User report (via the owner):** at about **3000 m altitude** (Z = 3000; skyboxes are commonly built there), the user sees flickering in: - **shadow maps**; - **stars**; - "some other things". **Likely cause:** precision. Something is computed in region or world space with 32-bit floats when it should be camera-relative: transforms, light/shadow matrices, sky dome/star positions, or depth reconstruction. At Z of about 3000, float32 resolution is about 0.24 mm in position, but errors compound once positions get multiplied through view-projection matrices built in world space. They're also amplified by: - shadow-cascade texel snapping; - view-space depth reconstruction; - TAA reprojection; - RT ray origins. **Investigate (GPU-driven VK pipeline):** - how model/view/projection are built (camera-relative rendering, or world-space MVP); - shadow cascade fitting and stabilisation (texel snapping in world vs light space); - the sky/stars/moon/clouds draw (dome centred on the camera? star positions far away in float?); - depth-to-position reconstruction in deferred lighting, SSR, AO and god rays; - reflection probes; - TAA / motion vectors (previous-frame matrices); - RT TLAS instance transforms and ray origins; - water and terrain at altitude (water plane far below). **Repro:** rez a platform at Z 3000 (or teleport to a skybox), stand still, enable sun shadows, watch shadows and stars. Compare with the same scene at Z 30. **Done when:** no flicker or shimmer at Z 3000 (also check 4000+, up to the 4096 build limit, and higher where avatars can fly), and nothing changes near the ground.
sky_line added this to the Slipstream project 2026-10-08 08:47:00 +00:00
Author
Owner

Merged in from #519 (the in-viewer report from the same user, on 1.0.1.1, region "The Mares Nest"; the reporter's home parcel is high up). The symptoms they described there:

  • shadows "behave a little weird" on both Real-time and Balanced;
  • on Balanced and Performance, "a weird big shadow that follows the player all the time";
  • stars jump from place to place in the night sky at their home parcel;
  • terrain stutters constantly, in a few places only.

All consistent with precision loss at high altitude. The big shadow that follows the player may be the coarse cascade or a shadow-map edge being placed from badly conditioned world-space maths.

Merged in from #519 (the in-viewer report from the same user, on 1.0.1.1, region "The Mares Nest"; the reporter's home parcel is high up). The symptoms they described there: - shadows "behave a little weird" on both Real-time and Balanced; - on **Balanced and Performance**, "a weird big shadow that follows the player all the time"; - **stars jump from place to place** in the night sky at their home parcel; - **terrain stutters constantly**, in a few places only. All consistent with precision loss at high altitude. The big shadow that follows the player may be the coarse cascade or a shadow-map edge being placed from badly conditioned world-space maths.
Author
Owner

Floating-origin precision fixes shipped in v1.2.0-beta.4; reporter was on 1.0.1.1. Closing as fixed; reopen if shadows/stars flicker at high altitude on current builds.

Floating-origin precision fixes shipped in v1.2.0-beta.4; reporter was on 1.0.1.1. Closing as fixed; reopen if shadows/stars flicker at high altitude on current builds.
sky_line 2026-10-11 13:25:10 +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#555
No description provided.