ambient: bound the light of particles and dust indoors (VICTORY_AMBIENT_ALPHA) #186

Manually merged
github merged 1 commit from github-bot/gh-186 into main 2026-12-02 16:17:43 +00:00 AGit
Owner

@⁠Spel0 on GitHub · 2026-12-02 13:33 UTC · original
Spel0:fix/particle-fog → main · +76 −3 · 4 files · 1 commits · merged 2026-12-02 16:13 UTC

What this fixes

In some indoor bar scenes the picture fills with a pale fog and white specks: dust, smoke and transparent surfaces are lit as if they were under the open sky. With VICTORY_AMBIENT_ALPHA=1 the same interiors are clear, with no measurable frame-time cost in the captures below.

Before — bar interior with the particle haze and white specks:

Before: particle haze and white specks indoors

After — bar interior with VICTORY_AMBIENT_ALPHA=1:

After: bar interior with the bound on, clear

What was wrong

The title lights transparent surfaces and particles from a 32x16x64 volume in front of the eye:

CS_GatherAlphaVBuffer -> CS_ShadeAlpha -> CS_VarianceFilterAlpha -> CS_SpatialFilterAlpha

When the ray-tracing structure builder is off (or its rays find nothing), every ray in that chain falls back to the open sky. Indoors the volume therefore holds sky radiance, and glass, dust and smoke are lit as if they were outdoors. The existing VICTORY_AMBIENT_AIR bound only covers the air volume (CS_AccumulateLocalLightInscatteringVolume); the alpha volume was left unbounded, so the white specks and the haze remained.

This is the same mechanism reported in the other VIctory trees; the volume was already known, but this fork's stand-in did not touch it.

Change

  • New ambient::Role::Alpha for CS_SpatialFilterAlpha.
  • The volume is at table 1, dword 24 (ALPHA; R11G11B10, 3D), and is bounded right after the program by the same pass that bounds the air's light.
  • New setting VICTORY_AMBIENT_ALPHA=<multiple>: default 1 (on), 0 leaves the title's own output. Also listed in run.conf.default / the F1 menu as 0|0.5|1|2|4.
  • Works for direct and indirect dispatches.
  • The role is chosen when the pipeline is made, not in the translation, so the shader cache key does not change.

The bound runs only when the ambient stand-in is active: VICTORY_AMBIENT is not off, and either the BVH builder is not running or VICTORY_AMBIENT_RT is set. That is the same condition as the other ambient bounds.

Tested

Reporter's machine and settings:

  • AMD Ryzen 5 7600
  • Radeon RX 6800 XT
  • 1920x1080 -> 3840x2160, FSR 4 Performance, frame generation off
  • Before: 21.4 FPS / 46.8 ms. After: 21.5 FPS / 46.4 ms (panel readings in the two captures)

With VICTORY_AMBIENT_ALPHA=1 the bar interiors are clear in play. VICTORY_AMBIENT_ALPHA=0 restores the title's own output for comparison.

Not tested here: other GPUs, other scenes, a long session, or the VICTORY_AMBIENT=constant: path (like the air bound, the alpha bound is skipped there).

Files

  • crates/victory-gpu/src/ambient.rs — Role::Alpha, the setting, the bound, and tests
  • crates/victory-gpu/src/draw.rs — role table/slot and 3D target validation
  • run.conf.default, README.md — the setting

Credits

The alpha-volume bound was first implemented in KyleS98/VIctory-Neo (a6e85c6) and ProjectLeonida/mandy (915f7654, dc644c6); hotscarlett (59ed272) and skornuta/victory-stas (bad4ac58) ported and tested it under the same VICTORY_AMBIENT_ALPHA name. This PR adapts it to this tree's stand-in roles and dispatch routing.

Written with AI assistance (DeepSeek V4.1 Flash via OpenCode).

**@⁠Spel0** on GitHub · 2026-12-02 13:33 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/186) `Spel0:fix/particle-fog` → `main` · +76 −3 · 4 files · 1 commits · merged 2026-12-02 16:13 UTC ## What this fixes In some indoor bar scenes the picture fills with a pale fog and white specks: dust, smoke and transparent surfaces are lit as if they were under the open sky. With `VICTORY_AMBIENT_ALPHA=1` the same interiors are clear, with no measurable frame-time cost in the captures below. **Before** — bar interior with the particle haze and white specks: ![Before: particle haze and white specks indoors](https://github.com/user-attachments/assets/f5e86fc9-244c-486b-8d67-e14f2e2f64e0) **After** — bar interior with `VICTORY_AMBIENT_ALPHA=1`: ![After: bar interior with the bound on, clear](https://github.com/user-attachments/assets/fe2657ea-4a28-4d98-a21c-421a36e911a3) ## What was wrong The title lights transparent surfaces and particles from a 32x16x64 volume in front of the eye: `CS_GatherAlphaVBuffer` -> `CS_ShadeAlpha` -> `CS_VarianceFilterAlpha` -> `CS_SpatialFilterAlpha` When the ray-tracing structure builder is off (or its rays find nothing), every ray in that chain falls back to the open sky. Indoors the volume therefore holds sky radiance, and glass, dust and smoke are lit as if they were outdoors. The existing `VICTORY_AMBIENT_AIR` bound only covers the *air* volume (`CS_AccumulateLocalLightInscatteringVolume`); the alpha volume was left unbounded, so the white specks and the haze remained. This is the same mechanism reported in the other VIctory trees; the volume was already known, but this fork's stand-in did not touch it. ## Change - New `ambient::Role::Alpha` for `CS_SpatialFilterAlpha`. - The volume is at table 1, dword 24 (`ALPHA`; R11G11B10, 3D), and is bounded right after the program by the same pass that bounds the air's light. - New setting `VICTORY_AMBIENT_ALPHA=<multiple>`: default `1` (on), `0` leaves the title's own output. Also listed in `run.conf.default` / the F1 menu as `0|0.5|1|2|4`. - Works for direct and indirect dispatches. - The role is chosen when the pipeline is made, not in the translation, so the shader cache key does not change. The bound runs only when the ambient stand-in is active: `VICTORY_AMBIENT` is not off, and either the BVH builder is not running or `VICTORY_AMBIENT_RT` is set. That is the same condition as the other ambient bounds. ## Tested Reporter's machine and settings: - AMD Ryzen 5 7600 - Radeon RX 6800 XT - 1920x1080 -> 3840x2160, FSR 4 Performance, frame generation off - Before: 21.4 FPS / 46.8 ms. After: 21.5 FPS / 46.4 ms (panel readings in the two captures) With `VICTORY_AMBIENT_ALPHA=1` the bar interiors are clear in play. `VICTORY_AMBIENT_ALPHA=0` restores the title's own output for comparison. Not tested here: other GPUs, other scenes, a long session, or the `VICTORY_AMBIENT=constant:` path (like the air bound, the alpha bound is skipped there). ## Files - `crates/victory-gpu/src/ambient.rs` — `Role::Alpha`, the setting, the bound, and tests - `crates/victory-gpu/src/draw.rs` — role table/slot and 3D target validation - `run.conf.default`, `README.md` — the setting ## Credits The alpha-volume bound was first implemented in KyleS98/VIctory-Neo (`a6e85c6`) and ProjectLeonida/mandy (`915f7654`, `dc644c6`); hotscarlett (`59ed272`) and skornuta/victory-stas (`bad4ac58`) ported and tested it under the same `VICTORY_AMBIENT_ALPHA` name. This PR adapts it to this tree's stand-in roles and dispatch routing. Written with AI assistance (DeepSeek V4.1 Flash via OpenCode).
Without ray-tracing structures the title's alpha volume (CS_SpatialFilterAlpha, 32x16x64) keeps the open sky's light indoors. Smoke and dust then render as a pale fog veil and white specks over the picture (the bar interiors).

Bound that volume to VICTORY_AMBIENT_ALPHA times the light around right after the program that writes it, with the pass that bounds the air's light. On by default at 1; 0 leaves the title's own output. Adds Role::Alpha beside Role::Air, the volume at table 1 dword 24, and the F1/run.conf setting.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 13:38:30 +00:00
Author
Owner

@⁠kyle41313 on GitHub · 2026-12-02 14:19 UTC · original

Tested this PR on another card and scene. It fixes the same fault there.

Setup. RX 9070 XT, RADV, Proton Experimental 11.0, ray tracing off (VICTORY_BVH_BUILDER=0). Built from d044248 plus this PR's commit (e5a0032), with VICTORY_AMBIENT_ALPHA=1. The build also carried our three glass fixes (#193, #194, #195), which touch other code.

Scene. The player's house in an early open-world save. Without the bound, the floorboards, beds and door frames show a blue-white veil, and white specks float in the rooms.

Result. With this PR the veil and the specks are gone. Sunlit window glass looked the same as with the bound at 2. That was checked by eye in game, not measured.

**@⁠kyle41313** on GitHub · 2026-12-02 14:19 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/186#issuecomment-7348349586) Tested this PR on another card and scene. It fixes the same fault there. **Setup.** RX 9070 XT, RADV, Proton Experimental 11.0, ray tracing off (`VICTORY_BVH_BUILDER=0`). Built from d044248 plus this PR's commit (e5a0032), with `VICTORY_AMBIENT_ALPHA=1`. The build also carried our three glass fixes (#193, #194, #195), which touch other code. **Scene.** The player's house in an early open-world save. Without the bound, the floorboards, beds and door frames show a blue-white veil, and white specks float in the rooms. **Result.** With this PR the veil and the specks are gone. Sunlit window glass looked the same as with the bound at 2. That was checked by eye in game, not measured.
github manually merged commit 6fdd5b3394 into main 2026-12-02 16:17:43 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.