[pr-fix][rendering][lighting] Bound indoor particle and dust light via DARNER_AMBIENT_ALPHA #94

Manually merged
TrustNo1 merged 1 commit from hingeowl/Darner:vercetti/ambient-alpha into main 2026-12-04 03:25:30 +00:00
Contributor

Summary

Adds DARNER_AMBIENT_ALPHA=<multiple> (Role::Alpha for CS_SpatialFilterAlpha, default 1 when ambient lighting is active; 0 disables) to bound the light that transparent surfaces, particles, and dust receive indoors when ray tracing is off.

Provenance

  • Ported from https://github.com/lobomfz/VIctory-xmem commit e5a00326a064326bfb3bd0979fd5b02419eef2ce (GPL-3.0-or-later), adapted to Darner's ambient.rs and draw.rs.
  • Rebased cleanly onto main (b3a615f).

Validation

  • Unit tests: cargo test --locked -p darner-gpu --lib ambient passed.
  • 2-round 60 s interleaved spinning-camera A/B (RTX 4090 / Ryzen 9 7950X3D, Series X, 1440p, RT off, DARNER_AMBIENT=0.8 + DARNER_AMBIENT_AIR=1 enabled, DARNER_AMBIENT_ALPHA=0 vs 1, same binary):
Metric DARNER_AMBIENT_ALPHA=0 (R1 / R2) DARNER_AMBIENT_ALPHA=1 (R1 / R2)
Draws/frame 7,892 / 7,814 7,703 / 8,712
FPS (median) 21.9 / 20.9 21.2 / 21.8
FrameMedMs 46.7 / 48.4 ms 47.1 / 46.9 ms
FrameP95Ms 58.8 / 61.5 ms 58.6 / 60.0 ms
SubmitMs 32.0 / 32.7 ms 31.5 / 31.8 ms
GPU Busy / VRAM 65% / 21,837 MB 65% / 21,733 MB
  • Result: Zero performance or GPU overhead (even in R2 with +10% camera-phase draws, FrameMedMs was 46.9 ms vs 48.4 ms), and screenshots inspected visually spotless (nonBlack=99.99%, magenta=0%).
  • (Reference baseline on unmodified main b3a615f: 19.4 FPS, 49.6 ms med, 65.0 ms P95, 35.1 ms submit, 7,946 draws.)
## Summary Adds `DARNER_AMBIENT_ALPHA=<multiple>` (`Role::Alpha` for `CS_SpatialFilterAlpha`, default `1` when ambient lighting is active; `0` disables) to bound the light that transparent surfaces, particles, and dust receive indoors when ray tracing is off. ## Provenance - Ported from `https://github.com/lobomfz/VIctory-xmem` commit `e5a00326a064326bfb3bd0979fd5b02419eef2ce` (GPL-3.0-or-later), adapted to Darner's `ambient.rs` and `draw.rs`. - Rebased cleanly onto `main` (`b3a615f`). ## Validation - **Unit tests:** `cargo test --locked -p darner-gpu --lib ambient` passed. - **2-round 60 s interleaved spinning-camera A/B** (RTX 4090 / Ryzen 9 7950X3D, Series X, 1440p, RT off, **`DARNER_AMBIENT=0.8` + `DARNER_AMBIENT_AIR=1`** enabled, `DARNER_AMBIENT_ALPHA=0` vs `1`, same binary): | Metric | `DARNER_AMBIENT_ALPHA=0` (R1 / R2) | `DARNER_AMBIENT_ALPHA=1` (R1 / R2) | |---|---:|---:| | **Draws/frame** | `7,892` / `7,814` | `7,703` / `8,712` | | **FPS (median)** | `21.9` / `20.9` | `21.2` / `21.8` | | **FrameMedMs** | `46.7` / `48.4 ms` | `47.1` / `46.9 ms` | | **FrameP95Ms** | `58.8` / `61.5 ms` | `58.6` / `60.0 ms` | | **SubmitMs** | `32.0` / `32.7 ms` | `31.5` / `31.8 ms` | | **GPU Busy / VRAM** | `65%` / `21,837 MB` | `65%` / `21,733 MB` | - **Result:** Zero performance or GPU overhead (even in R2 with +10% camera-phase draws, `FrameMedMs` was `46.9 ms` vs `48.4 ms`), and screenshots inspected visually spotless (`nonBlack=99.99%`, `magenta=0%`). - *(Reference baseline on unmodified `main` `b3a615f`: `19.4 FPS`, `49.6 ms` med, `65.0 ms` P95, `35.1 ms` submit, `7,946` draws.)*
Ported from VIctory-xmem e5a00326, adapted to Darner's ambient.rs/draw.rs.

Upstream-Repository: https://github.com/lobomfz/VIctory-xmem
Upstream-Commit: e5a00326a064326bfb3bd0979fd5b02419eef2ce
First-time contributor

Test report: the glowing indoor dust is gone with this PR, and it comes back with DARNER_AMBIENT_ALPHA=0. No new artifacts found.

Hardware: Intel Core i9-12900F, RTX 4070 SUPER 12 GB, 32 GB DDR4-3200, Windows 11 (build 26200), NVIDIA driver 617.42.

Builds:

  • v2026.12.03.01 (bd0de0c) + this PR (d3c4b78), built from source, release profile. The same build also had #37, #59 and #93 (DARNER_LATE_FENCE off).
  • Plain v2026.12.03.01 (bd0de0c), built from source, for comparison.

Settings: Series S, DLSS Performance, frame generation 2x, ray tracing off. DARNER_AMBIENT=0.8 and DARNER_AMBIENT_AIR=1 (the defaults in the log).

Method: the same save and the same route each time: an indoor mission room with a dim back area, a dark storage depot, streets, a workshop. Three sessions:

  1. This PR with its default (DARNER_AMBIENT_ALPHA=1), about 21 min.
  2. Plain v2026.12.03.01, about 25 min.
  3. This PR with DARNER_AMBIENT_ALPHA=0 (--set), about 10 min (only the indoor spots).
PR, alpha 1 plain v2026.12.03.01 PR, alpha 0
Glowing dust floating indoors (back room, depot) gone visible visible

Notes:

  • Switching the PR's own setting brings the dust back, so the change comes from this PR and not from the other PRs in the build.
  • A few black specks showed for some seconds on a close-up paper texture (a notepad held in hand). They showed with alpha 1 and with alpha 0, then went away, so they are not from this PR.
  • The ground fog of #20 did not show in the depot on plain v2026.12.03.01 either, so this test says nothing about fog.
  • I did not measure the frame rate of this PR alone. My play sessions vary too much to separate it, and I noticed no extra stutter.
  • No crashes in the PR sessions.
Test report: the glowing indoor dust is gone with this PR, and it comes back with `DARNER_AMBIENT_ALPHA=0`. No new artifacts found. **Hardware:** Intel Core i9-12900F, RTX 4070 SUPER 12 GB, 32 GB DDR4-3200, Windows 11 (build 26200), NVIDIA driver 617.42. **Builds:** - v2026.12.03.01 (bd0de0c) + this PR (d3c4b78), built from source, release profile. The same build also had #37, #59 and #93 (`DARNER_LATE_FENCE` off). - Plain v2026.12.03.01 (bd0de0c), built from source, for comparison. **Settings:** Series S, DLSS Performance, frame generation 2x, ray tracing off. `DARNER_AMBIENT=0.8` and `DARNER_AMBIENT_AIR=1` (the defaults in the log). **Method:** the same save and the same route each time: an indoor mission room with a dim back area, a dark storage depot, streets, a workshop. Three sessions: 1. This PR with its default (`DARNER_AMBIENT_ALPHA=1`), about 21 min. 2. Plain v2026.12.03.01, about 25 min. 3. This PR with `DARNER_AMBIENT_ALPHA=0` (`--set`), about 10 min (only the indoor spots). | | PR, alpha 1 | plain v2026.12.03.01 | PR, alpha 0 | |---|---|---|---| | Glowing dust floating indoors (back room, depot) | gone | visible | visible | **Notes:** - Switching the PR's own setting brings the dust back, so the change comes from this PR and not from the other PRs in the build. - A few black specks showed for some seconds on a close-up paper texture (a notepad held in hand). They showed with alpha 1 and with alpha 0, then went away, so they are not from this PR. - The ground fog of #20 did not show in the depot on plain v2026.12.03.01 either, so this test says nothing about fog. - I did not measure the frame rate of this PR alone. My play sessions vary too much to separate it, and I noticed no extra stutter. - No crashes in the PR sessions.
TrustNo1 manually merged commit ad070f0731 into main 2026-12-04 03:25:30 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
TrustNo1/Darner!94
No description provided.