fix(volumetrics): adapt depth slices to max distance #981

Merged
SakulFlee merged 1 commit from fix/volumetric-adaptive-depth into main 2026-10-29 22:11:31 +00:00
Owner

Summary

Scales the froxel depth-slice count with the configured maximum distance.

The flicker pattern was not caused by max distance directly; it was the fixed number of depth slices being spread over a larger world-space range:

  • 64 slices at 10 units -> ~0.16 units per slice
  • 64 slices at 18 units -> ~0.28 units per slice
  • 64 slices at 30 units -> ~0.47 units per slice

That matches the observed “flicker interval” growing with max distance.

The renderer now targets roughly 0.15 world units per depth slice for the normal quality tiers:

  • 10 units -> 67 slices
  • 18 units -> 120 slices
  • 30 units -> 192 slices
  • larger ranges are capped at 192 slices

X/Y resolution still follows VolumetricQuality; Custom quality keeps its explicit grid size. This preserves the longer range while keeping short spot cones stable.

Validation

  • cargo test -p orbital_renderer --all-targets passes.
  • cargo check --workspace with the workspace clippy driver and -D warnings passes.
  • rustfmt --check passes.
  • No GPU visual validation was possible locally.

Related: #976, #978, #979.

## Summary Scales the froxel depth-slice count with the configured maximum distance. The flicker pattern was not caused by max distance directly; it was the fixed number of depth slices being spread over a larger world-space range: - 64 slices at 10 units -> ~0.16 units per slice - 64 slices at 18 units -> ~0.28 units per slice - 64 slices at 30 units -> ~0.47 units per slice That matches the observed “flicker interval” growing with max distance. The renderer now targets roughly **0.15 world units per depth slice** for the normal quality tiers: - 10 units -> 67 slices - 18 units -> 120 slices - 30 units -> 192 slices - larger ranges are capped at 192 slices X/Y resolution still follows `VolumetricQuality`; `Custom` quality keeps its explicit grid size. This preserves the longer range while keeping short spot cones stable. ## Validation - `cargo test -p orbital_renderer --all-targets` passes. - `cargo check --workspace` with the workspace clippy driver and `-D warnings` passes. - `rustfmt --check` passes. - No GPU visual validation was possible locally. Related: #976, #978, #979.
fix(volumetrics): adapt depth slices to max distance
All checks were successful
Lint / lint (pull_request) Successful in 1m10s
PR / test (pull_request) Successful in 2m58s
ff6a0b0e93

Smart test results

Result: PASS

Scope: orbital_renderer

Reason: directly changed crates

Elapsed: 2m 26s

Workflow run

Overall: 17 tests, 17 passed, 0 failed, 0 skipped

Nextest: 17 tests, 17 passed, 0 failed, 0 skipped
Doctests: no tests reported

Crate Nextest Passed Failed Skipped Doctests Time
orbital_renderer 17 17 0 0 - 0.19s
pie showData
    title Nextest outcomes
    "Passed" : 17
<!-- orbital-ci-test-results --> ## Smart test results **Result:** PASS **Scope:** orbital_renderer **Reason:** directly changed crates **Elapsed:** 2m 26s [Workflow run](https://forgejo.sakul-flee.de/SakulFlee/Orbital/actions/runs/875) **Overall:** 17 tests, 17 passed, 0 failed, 0 skipped **Nextest:** 17 tests, 17 passed, 0 failed, 0 skipped **Doctests:** no tests reported | Crate | Nextest | Passed | Failed | Skipped | Doctests | Time | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | orbital_renderer | 17 | 17 | 0 | 0 | - | 0.19s | ```mermaid pie showData title Nextest outcomes "Passed" : 17 ```
Sign in to join this conversation.
No description provided.