[pr-fix][rendering][lighting] Indoor air held to the surface seen (DARNER_AMBIENT_AIR_ROOM=1, off by default) #18

Open
Jesper-A wants to merge 2 commits from Jesper-A/Darner:pr6-air-room into main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit.

Base: the branch (2 commits) is on 4db98e011, the main commit it was cut from. main is now 4a92569fb. Not rebased (WIP; we rebase before WIP comes off, or sooner if you ask). A text-only trial merge (git merge-tree --write-tree --name-only trustno1/main pr6-air-room) conflicts in crates/darner-gpu/src/ambient.rs only; README.md merges cleanly. The conflict comes from the "Guard ambient lighting until GPU estimates are ready" change (merged into main as 3b7b6c6e9), which also edits ambient.rs.

This is a draft. It has not been run in the game on this base, and it has no before and after.

What was wrong (reported in the earlier repository, not reproduced by us). The fog cap (DARNER_AMBIENT_AIR, 1 in darner play's defaults) caps the air in each slice at a multiple of the light around. Near the camera that cap is the room's light alone (the mean of the last seconds). In a dark interior whose mean a menu's white text, a lamp or the outdoors had raised, the near air could glow up to that mean: a milky green veil over dark rooms, garages and the wardrobe and mod-shop menus, with ray tracing off. It was an issue in the project's earlier GitHub repository (no link; it is gone).

New switch: DARNER_AMBIENT_AIR_ROOM=1. Default: not set (off), nothing changes. With 1, the near end of the cap becomes the lesser of the room's light and the light of the surface seen in that direction (min(room, seen)), so the air in front of a dark wall cannot outshine it. Towards a bright window the cap still rises with distance to the window's light, so daylight haze and sunbeams outdoors stay. Only the fog cap's pass is touched, so it does nothing without DARNER_AMBIENT_AIR.

  • It is a #define AIR_ROOM of our host pass clear_air in ambient.rs, chosen when the passes are made (read once, air_room_asked). The title's shaders and the shader cache key are unchanged; there is no extra pass.
  • Tests: clear_air_cap_bounds_dark_interiors (the cap's sum on numbers, not the shader itself) and the existing the_passes_compile, which now also compiles the pass with the define.
  • Also: a README row (Lighting and ray tracing) and a docs/findings.md entry.

Diff against 4db98e011: 3 files (README.md, crates/darner-gpu/src/ambient.rs, docs/findings.md), 2 commits. It stands alone.

Credit: a port of dheerajc8073's commit 23e8243c3 in a fork of the project's earlier GitHub repository (that repository is gone, so there is no link), where the change was unconditional and the test is theirs. Here it is behind a switch, off by default. The commit message carries a Co-authored-by line.

No upstream issue covers this, so there is no Fixes or Refs line.

Spec dependence

  • Likely general: arithmetic in a host pass, no title shader.
  • May depend on our setup (RTX 2070 SUPER 8 GB Turing, ReBAR off, Ryzen 7 5800X, 32 GB, Series S + DLSS Performance): whether the veil shows at all (it depends on the scene's light and the title's volume); not compared on another card.
  • Untested elsewhere: every other setup, Series X profile, and any scene we did not look at.

How it was tested

  • Tested revision: 53938b084 (branch pr6-air-room, based on 4db98e011; main has moved, see Base).
  • Commands and results:
    • cargo clippy --workspace --all-targets --locked -- -D warnings with -A clippy::unnecessary_lazy_evaluations added: passed. The exact command without that flag was not run.
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings, the same flag added: passed.
    • Tests: darner-gpu, full library: 1671 passed, none failed (includes clear_air_cap_bounds_dark_interiors and the_passes_compile). cargo test --workspace --locked as one command was not run.
    • cargo xtask policy: passed.
    • There is no CI upstream; nothing here was checked by CI.
  • Gameplay, when relevant: RTX 2070 SUPER 8 GB, Series S (recorded as "Series S 720 quality"; the ray tracing mode was not recorded), clocks unlocked. On 2026-12-02 the user played with DARNER_AMBIENT_AIR_ROOM=1 (and DARNER_RAYMISS_CLEAR=1, not part of this PR) on our play build, which was older than current main. The user's words: "Our reflection and glass ports seem to work well". That is an impression about the pair: no scene, no screenshot pair, no A/B, and no look at a dark interior was recorded. A glow on glass and windows seen in the same days was fixed by an upstream update, not by this switch. Nothing was run on the tested revision above.
  • Before and after, when relevant: none.
  • Shader wave sizes tested, when relevant: not tested. The pass is a host compute pass of ours compiled at run time; the define adds a few lines of arithmetic.
  • Coverage gaps: no same-scene comparison on or off; the veil itself was not reproduced by us; ray tracing on (the estimates stand aside when rays are found, so no effect expected); AMD and wave64; the cost (expected none, not measured); the branch on current main (it conflicts in ambient.rs).

Checklist

  • This PR contains one change based on main. (git diff --stat 4db98e011 53938b084: the 3 files above. The branch is on 4db98e011, not on current main; a trial merge conflicts in ambient.rs, see Base.)
  • The diff follows docs/asset-policy.md. (Text only; cargo xtask policy passed.)
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for this switch. On 2026-12-03 this host had 4 issues (#1, #2, #4, #13) and 12 pull requests (#3 by another contributor; #5 to #12 and #14 to #16 ours, WIP) in total; I searched their titles and bodies for air, fog, milky and veil: nothing. The other contributor's pull request (#3, ray tracing mode in F1) changes host/menu.rs, host/panel.rs and hwrt.rs: none of this change's files. The ambient-guard change that now conflicts (3b7b6c6e9) is already in main; it also edits clear_air, so this branch needs a rebase there. An earlier PR of ours that added lower F1 FOG CAP steps (CodeFloe, not migrated; it is in main) lowers the cap everywhere, while this keeps the cap and holds only the near air to the surface seen. Our other reflection branches (pr6-raymiss-estimated, pr6-raymiss-clear, pr6-specular-fill) bump the same README count, and pr6-specular-fill also edits ambient.rs. An earlier CodeFloe report of lighting jumps with ray tracing off (not migrated) is related, not claimed fixed.
  • Our own re-filed PRs that touch the same files: #6 (README.md, docs/findings.md); #7 (docs/findings.md); #8 (README.md, docs/findings.md); #9 (README.md, docs/findings.md); #10 (README.md, docs/findings.md); #11 (README.md); #12 (README.md, docs/findings.md); #14 (README.md, crates/darner-gpu/src/ambient.rs, docs/findings.md); #15 (README.md, docs/findings.md); #16 (README.md, docs/findings.md). #5 share no file. Different changes; whichever lands first, the others take its rows when they are rebased.

Update 2026-12-03: marked ready as it stands; the 'draft' and 'not rebased' wording above is out of date, nothing was re-run in the game, and the maintainer will handle the rebase.

This change was made with AI assistance (Claude Code).

## Contributor role (optional) - Fluxer ID: ## What it changes Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit. **Base:** the branch (2 commits) is on `4db98e011`, the `main` commit it was cut from. `main` is now `4a92569fb`. Not rebased (WIP; we rebase before WIP comes off, or sooner if you ask). A text-only trial merge (`git merge-tree --write-tree --name-only trustno1/main pr6-air-room`) **conflicts** in `crates/darner-gpu/src/ambient.rs` only; `README.md` merges cleanly. The conflict comes from the "Guard ambient lighting until GPU estimates are ready" change (merged into `main` as `3b7b6c6e9`), which also edits `ambient.rs`. This is a draft. It has not been run in the game on this base, and it has no before and after. **What was wrong (reported in the earlier repository, not reproduced by us).** The fog cap (`DARNER_AMBIENT_AIR`, `1` in `darner play`'s defaults) caps the air in each slice at a multiple of the light around. Near the camera that cap is the room's light alone (the mean of the last seconds). In a dark interior whose mean a menu's white text, a lamp or the outdoors had raised, the near air could glow up to that mean: a milky green veil over dark rooms, garages and the wardrobe and mod-shop menus, with ray tracing off. It was an issue in the project's earlier GitHub repository (no link; it is gone). **New switch: `DARNER_AMBIENT_AIR_ROOM=1`.** Default: not set (off), nothing changes. With `1`, the near end of the cap becomes the lesser of the room's light and the light of the surface seen in that direction (`min(room, seen)`), so the air in front of a dark wall cannot outshine it. Towards a bright window the cap still rises with distance to the window's light, so daylight haze and sunbeams outdoors stay. Only the fog cap's pass is touched, so it does nothing without `DARNER_AMBIENT_AIR`. - It is a `#define AIR_ROOM` of our host pass `clear_air` in `ambient.rs`, chosen when the passes are made (read once, `air_room_asked`). The title's shaders and the shader cache key are unchanged; there is no extra pass. - Tests: `clear_air_cap_bounds_dark_interiors` (the cap's sum on numbers, not the shader itself) and the existing `the_passes_compile`, which now also compiles the pass with the define. - Also: a README row (Lighting and ray tracing) and a `docs/findings.md` entry. Diff against `4db98e011`: 3 files (`README.md`, `crates/darner-gpu/src/ambient.rs`, `docs/findings.md`), 2 commits. It stands alone. **Credit:** a port of **dheerajc8073**'s commit `23e8243c3` in a fork of the project's earlier GitHub repository (that repository is gone, so there is no link), where the change was unconditional and the test is theirs. Here it is behind a switch, off by default. The commit message carries a `Co-authored-by` line. No upstream issue covers this, so there is no `Fixes` or `Refs` line. ### Spec dependence - **Likely general:** arithmetic in a host pass, no title shader. - **May depend on our setup** (RTX 2070 SUPER 8 GB Turing, ReBAR off, Ryzen 7 5800X, 32 GB, Series S + DLSS Performance): whether the veil shows at all (it depends on the scene's light and the title's volume); not compared on another card. - **Untested elsewhere:** every other setup, Series X profile, and any scene we did not look at. ## How it was tested - Tested revision: `53938b084` (branch `pr6-air-room`, based on `4db98e011`; `main` has moved, see Base). - Commands and results: - `cargo clippy --workspace --all-targets --locked -- -D warnings` with `-A clippy::unnecessary_lazy_evaluations` added: passed. The exact command without that flag was not run. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`, the same flag added: passed. - Tests: `darner-gpu`, full library: 1671 passed, none failed (includes `clear_air_cap_bounds_dark_interiors` and `the_passes_compile`). `cargo test --workspace --locked` as one command was not run. - `cargo xtask policy`: passed. - There is no CI upstream; nothing here was checked by CI. - Gameplay, when relevant: RTX 2070 SUPER 8 GB, Series S (recorded as "Series S 720 quality"; the ray tracing mode was not recorded), clocks unlocked. On 2026-12-02 the user played with `DARNER_AMBIENT_AIR_ROOM=1` (and `DARNER_RAYMISS_CLEAR=1`, not part of this PR) on our play build, which was older than current `main`. The user's words: "Our reflection and glass ports seem to work well". That is an impression about the pair: no scene, no screenshot pair, no A/B, and no look at a dark interior was recorded. A glow on glass and windows seen in the same days was fixed by an upstream update, not by this switch. Nothing was run on the tested revision above. - Before and after, when relevant: none. - Shader wave sizes tested, when relevant: not tested. The pass is a host compute pass of ours compiled at run time; the define adds a few lines of arithmetic. - Coverage gaps: no same-scene comparison on or off; the veil itself was not reproduced by us; ray tracing on (the estimates stand aside when rays are found, so no effect expected); AMD and wave64; the cost (expected none, not measured); the branch on current `main` (it conflicts in `ambient.rs`). ## Checklist - [x] This PR contains one change based on `main`. (`git diff --stat 4db98e011 53938b084`: the 3 files above. The branch is on `4db98e011`, not on current `main`; a trial merge conflicts in `ambient.rs`, see Base.) - [x] The diff follows `docs/asset-policy.md`. (Text only; `cargo xtask policy` passed.) - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for this switch. On 2026-12-03 this host had 4 issues (#1, #2, #4, #13) and 12 pull requests (#3 by another contributor; #5 to #12 and #14 to #16 ours, WIP) in total; I searched their titles and bodies for air, fog, milky and veil: nothing. The other contributor's pull request (#3, ray tracing mode in F1) changes `host/menu.rs`, `host/panel.rs` and `hwrt.rs`: none of this change's files. The ambient-guard change that now conflicts (`3b7b6c6e9`) is already in `main`; it also edits `clear_air`, so this branch needs a rebase there. An earlier PR of ours that added lower F1 FOG CAP steps (CodeFloe, not migrated; it is in `main`) lowers the cap everywhere, while this keeps the cap and holds only the near air to the surface seen. Our other reflection branches (`pr6-raymiss-estimated`, `pr6-raymiss-clear`, `pr6-specular-fill`) bump the same README count, and `pr6-specular-fill` also edits `ambient.rs`. An earlier CodeFloe report of lighting jumps with ray tracing off (not migrated) is related, not claimed fixed. - Our own re-filed PRs that touch the same files: #6 (`README.md`, `docs/findings.md`); #7 (`docs/findings.md`); #8 (`README.md`, `docs/findings.md`); #9 (`README.md`, `docs/findings.md`); #10 (`README.md`, `docs/findings.md`); #11 (`README.md`); #12 (`README.md`, `docs/findings.md`); #14 (`README.md`, `crates/darner-gpu/src/ambient.rs`, `docs/findings.md`); #15 (`README.md`, `docs/findings.md`); #16 (`README.md`, `docs/findings.md`). #5 share no file. Different changes; whichever lands first, the others take its rows when they are rebased. Update 2026-12-03: marked ready as it stands; the 'draft' and 'not rebased' wording above is out of date, nothing was re-run in the game, and the maintainer will handle the rebase. This change was made with AI assistance (Claude Code).
The air pass after the title's local-light inscattering volume caps the near
slices at the room's light alone. In a dark interior whose room mean a menu,
a lamp or the outdoors raised, the near air glowed up to it: a milky green
veil over dark rooms, garages and the wardrobe and mod-shop menus with ray
tracing off (old GitHub issue #1395). With the switch the near cap is the
lesser of the room's light and the surface's in that direction; towards a
bright window it still rises with distance. A define of our air pass, chosen
when the passes are made; the title's shaders and the shader cache key are
unchanged.

Port of dheerajc8073's fork commit 23e8243c3 (old GitHub #1395), where it
was unconditional; their test clear_air_cap_bounds_dark_interiors is kept.

Co-authored-by: dheerajc8073 <[email protected]>

This change was made with AI assistance (Claude Code).
The row and the findings entry for the commit before (port of dheerajc8073's fork commit 23e8243c3, old GitHub #1395).

This change was made with AI assistance (Claude Code).
Jesper-A changed title from WIP: [pr-fix][rendering][lighting] Indoor air held to the surface seen (DARNER_AMBIENT_AIR_ROOM=1, off by default) to [pr-fix][rendering][lighting] Indoor air held to the surface seen (DARNER_AMBIENT_AIR_ROOM=1, off by default) 2026-12-03 18:30:21 +00:00
This pull request has changes conflicting with the target branch.
  • crates/darner-gpu/src/ambient.rs
  • docs/findings.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'pr6-air-room:Jesper-A-pr6-air-room'
git switch 'Jesper-A-pr6-air-room'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'Jesper-A-pr6-air-room'
git switch 'Jesper-A-pr6-air-room'
git rebase 'main'
git switch 'main'
git merge --ff-only 'Jesper-A-pr6-air-room'
git switch 'Jesper-A-pr6-air-room'
git rebase 'main'
git switch 'main'
git merge --no-ff 'Jesper-A-pr6-air-room'
git switch 'main'
git merge --squash 'Jesper-A-pr6-air-room'
git switch 'main'
git merge --ff-only 'Jesper-A-pr6-air-room'
git switch 'main'
git merge 'Jesper-A-pr6-air-room'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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
TrustNo1/Darner!18
No description provided.