WIP: Reflections: the specular fill is off while the rays are found (DARNER_AMBIENT_SPECULAR_FILL, off by default) #460

Draft
Jesper-A wants to merge 1 commit from Jesper-A/Darner:up-specular-fill-rays-gate into Main
Collaborator

Refs #17

Contributor role (optional)

  • Fluxer ID:

What it changes

The !rays_found() gate and the dropped duplicate half are ported from advxrsary's fork (commit dd8979582, via our branch pr6-specular-fill); the review point comes from TrustNo1 on #17.

Follow-up to #17 (merged at 2ecdc8714). It answers the review of #17 that main still lacks: #17 (comment). It is a new PR because #17 is merged. It uses Refs, not Fixes: the reviewer's third point (an in-game A/B of the floor grain against #14) is not part of this.

  • The problem on main: DARNER_AMBIENT_SPECULAR_FILL=1 fills after every miss dispatch, also with hardware or software ray tracing, where the miss program writes the real sky of the rays that found nothing. The fill would give those the light around, without a direction, which would flatten glass that faces the sky. This is the reviewer's point; read from the code (fill_asked() on main has no ray test), not run in game. Also, main's sky_miss_left_out still has the "program runs" half for fill_asked(), which the review said duplicates #14's.
  • What this does:
    • fill_asked() (crates/darner-gpu/src/ambient.rs) is also false when crate::pipeline::rays_found() is true. With the switch off or no reflection estimate, nothing changes.
    • sky_miss_left_out (crates/darner-gpu/src/draw.rs) loses its || fill_asked() half. With ray tracing off, the opaque layer's miss program now runs only under DARNER_RAYMISS_ESTIMATED=1 (with the reflection estimate on), as #14 does. With the rays found, miss_left_out returns false and the program runs anyway. So DARNER_AMBIENT_SPECULAR_FILL=1 alone fills only the layers whose program already runs; for the opaque layer, both switches are needed. This is a change for anyone who set only the fill switch.
    • The README row, the doc comment on fill_asked and docs/findings.md say so: the opaque layer needs DARNER_RAYMISS_ESTIMATED=1, and the fill is off while the rays are found.

Merge check: this branch is on main 47d21cd3b. Main is now d91d8e4d6. git merge-tree --write-tree trustno1/main <branch> gives a clean tree, no conflicts.

How it was tested

  • Tested revision: branch up-specular-fill-rays-gate @ 9f555f30b, based on main 47d21cd3b.
  • Commands and results, as run (scoped to -p darner-gpu; the three workspace gates were not run):
    • cargo test -p darner-gpu --lib with the filters ambient (16 passed) and draw (58 passed); cargo clippy -p darner-gpu -- -D warnings, plain and with --all-features, clean.
    • cargo xtask policy through the pre-commit hook: ok.
  • Changes a default: no. The switch stays off by default.
  • A/B result: none. A switch that is off by default; no speed or picture claim. The floor-grain A/B against #14 that the review asked for is not done.
  • Gates run on that revision: only the scoped ones above. Not run: the workspace clippy (with and without --all-features) and cargo test --workspace --locked. There is no CI.
  • Gameplay: not run in game. Not run here: glass facing the sky with ray tracing on and the fill switch on; the opaque layer with only the fill switch, and with both switches.
  • Shader wave sizes tested: no shader change; no shader cache key change.
  • Hardware dependence: see "Spec dependence".
  • Suspected, not measured: #268 throttles BLAS builds, which may leave more late-BLAS ray misses with hardware ray tracing on; the gate keeps the fill from painting over those. One more reason for the A/B the review asked for. (From our own read of the open PRs, not a measurement.)
  • Coverage gaps, to check in a real run before WIP: comes off: with hardware or software RT on and the fill switch on, sky-facing glass keeps the real sky; with RT off and both switches on, the shimmer of old pictures is still gone.

Spec dependence

  • Likely general: a switch test and a documentation change; no GPU specifics.
  • May depend on our specs: whether the grain on floors shows (depends on the scene and the reflection estimate), which is the open A/B.
  • Untested elsewhere: every card and both ray-tracing modes (no run at all).

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only). Not run in game; the unit tests cover the switch logic only.
  • This PR contains one change based on main: the ray gate on the fill, with the duplicate half and the text that goes with it.
  • The diff follows docs/asset-policy.md. (Code and text only; cargo xtask policy ok on the commit through the pre-commit hook.)
  • 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: #354 adds 4 lines to crates/darner-gpu/src/ambient.rs (Wine tests). #14 and #17, which this follows, are merged. Several open PRs touch draw.rs (#454, #431, #397, #394, #326, #187, #143, #57, #48); I did not compare hunks. None is about the specular fill.
  • Replaces or overlaps: none found.

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

Refs #17 ## Contributor role (optional) - Fluxer ID: ## What it changes The `!rays_found()` gate and the dropped duplicate half are ported from advxrsary's fork (commit dd8979582, via our branch pr6-specular-fill); the review point comes from TrustNo1 on #17. Follow-up to #17 (merged at `2ecdc8714`). It answers the review of #17 that main still lacks: https://git.gtahub.st/TrustNo1/Darner/pulls/17#issuecomment-859010. It is a new PR because #17 is merged. It uses `Refs`, not `Fixes`: the reviewer's third point (an in-game A/B of the floor grain against #14) is not part of this. - The problem on main: `DARNER_AMBIENT_SPECULAR_FILL=1` fills after every miss dispatch, also with hardware or software ray tracing, where the miss program writes the real sky of the rays that found nothing. The fill would give those the light around, without a direction, which would flatten glass that faces the sky. This is the reviewer's point; read from the code (`fill_asked()` on main has no ray test), not run in game. Also, main's `sky_miss_left_out` still has the "program runs" half for `fill_asked()`, which the review said duplicates #14's. - What this does: - `fill_asked()` (`crates/darner-gpu/src/ambient.rs`) is also false when `crate::pipeline::rays_found()` is true. With the switch off or no reflection estimate, nothing changes. - `sky_miss_left_out` (`crates/darner-gpu/src/draw.rs`) loses its `|| fill_asked()` half. With ray tracing off, the opaque layer's miss program now runs only under `DARNER_RAYMISS_ESTIMATED=1` (with the reflection estimate on), as #14 does. With the rays found, `miss_left_out` returns false and the program runs anyway. So `DARNER_AMBIENT_SPECULAR_FILL=1` alone fills only the layers whose program already runs; for the opaque layer, both switches are needed. This is a change for anyone who set only the fill switch. - The README row, the doc comment on `fill_asked` and `docs/findings.md` say so: the opaque layer needs `DARNER_RAYMISS_ESTIMATED=1`, and the fill is off while the rays are found. Merge check: this branch is on main `47d21cd3b`. Main is now `d91d8e4d6`. `git merge-tree --write-tree trustno1/main <branch>` gives a clean tree, no conflicts. ## How it was tested - Tested revision: branch `up-specular-fill-rays-gate` @ `9f555f30b`, based on main `47d21cd3b`. - Commands and results, as run (scoped to `-p darner-gpu`; the three workspace gates were not run): - `cargo test -p darner-gpu --lib` with the filters `ambient` (16 passed) and `draw` (58 passed); `cargo clippy -p darner-gpu -- -D warnings`, plain and with `--all-features`, clean. - `cargo xtask policy` through the pre-commit hook: ok. - Changes a default: no. The switch stays off by default. - A/B result: none. A switch that is off by default; no speed or picture claim. The floor-grain A/B against #14 that the review asked for is not done. - Gates run on that revision: only the scoped ones above. Not run: the workspace clippy (with and without `--all-features`) and `cargo test --workspace --locked`. There is no CI. - Gameplay: not run in game. Not run here: glass facing the sky with ray tracing on and the fill switch on; the opaque layer with only the fill switch, and with both switches. - Shader wave sizes tested: no shader change; no shader cache key change. - Hardware dependence: see "Spec dependence". - Suspected, not measured: #268 throttles BLAS builds, which may leave more late-BLAS ray misses with hardware ray tracing on; the gate keeps the fill from painting over those. One more reason for the A/B the review asked for. (From our own read of the open PRs, not a measurement.) - Coverage gaps, to check in a real run before `WIP:` comes off: with hardware or software RT on and the fill switch on, sky-facing glass keeps the real sky; with RT off and both switches on, the shimmer of old pictures is still gone. ## Spec dependence - Likely general: a switch test and a documentation change; no GPU specifics. - May depend on our specs: whether the grain on floors shows (depends on the scene and the reflection estimate), which is the open A/B. - Untested elsewhere: every card and both ray-tracing modes (no run at all). ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). Not run in game; the unit tests cover the switch logic only. - [x] This PR contains one change based on `main`: the ray gate on the fill, with the duplicate half and the text that goes with it. - [ ] The diff follows `docs/asset-policy.md`. (Code and text only; `cargo xtask policy` ok on the commit through the pre-commit hook.) - [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: #354 adds 4 lines to `crates/darner-gpu/src/ambient.rs` (Wine tests). #14 and #17, which this follows, are merged. Several open PRs touch `draw.rs` (#454, #431, #397, #394, #326, #187, #143, #57, #48); I did not compare hunks. None is about the specular fill. - Replaces or overlaps: none found. This change was made with AI assistance (Claude Code).
Follow-up to #17 as merged (it was not rebased on #14). fill_asked() also
requires !rays_found(): with ray tracing the miss program writes the real sky
of the rays that found nothing, which the light around would flatten
(maintainer review). The duplicate "program runs" half in sky_miss_left_out is
dropped, since #14's DARNER_RAYMISS_ESTIMATED covers it; the opaque layer is
therefore filled only with that switch on, as README and findings now say.
The KEPT/GATHERED gating of without_depth is not in main, so nothing to do.

Port of pr6-specular-fill 4d6e13564 / bceadbbb3 (advxrsary's fork commit dd8979582).

This change was made with AI assistance (Claude Code).
Jesper-A force-pushed up-specular-fill-rays-gate from 9f555f30b2 to 626001a7f1 2026-12-05 16:40:01 +00:00 Compare
Author
Collaborator

Closing this old-engine PR because post-merge replaced the code it changes: ambient.rs is gone, and host ray tracing builds real structures (rt.rs).

Written with AI assistance (Claude Code).

Closing this old-engine PR because post-merge replaced the code it changes: `ambient.rs` is gone, and host ray tracing builds real structures (`rt.rs`). Written with AI assistance (Claude Code).
Jesper-A closed this pull request 2026-12-06 01:26:18 +00:00
Jesper-A reopened this pull request 2026-12-06 01:51:49 +00:00
Author
Collaborator

Reopened: Main is the default branch again, so the close note above no longer applies.

Written with AI assistance (Claude Code).

Reopened: Main is the default branch again, so the close note above no longer applies. Written with AI assistance (Claude Code).
TrustNo1 changed title from WIP: [pr-fix][rendering][lighting] Reflections: the specular fill is off while the rays are found (DARNER_AMBIENT_SPECULAR_FILL, off by default) to WIP: Reflections: the specular fill is off while the rays are found (DARNER_AMBIENT_SPECULAR_FILL, off by default) 2026-12-06 03:28:42 +00:00
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'up-specular-fill-rays-gate:Jesper-A-up-specular-fill-rays-gate'
git switch 'Jesper-A-up-specular-fill-rays-gate'

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-up-specular-fill-rays-gate'
git switch 'Jesper-A-up-specular-fill-rays-gate'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'Jesper-A-up-specular-fill-rays-gate'
git switch 'Jesper-A-up-specular-fill-rays-gate'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'Jesper-A-up-specular-fill-rays-gate'
git switch 'Main'
git merge --squash 'Jesper-A-up-specular-fill-rays-gate'
git switch 'Main'
git merge --ff-only 'Jesper-A-up-specular-fill-rays-gate'
git switch 'Main'
git merge 'Jesper-A-up-specular-fill-rays-gate'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
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!460
No description provided.