[pr-fix][rendering][lighting] Reflections: the rays' image filled with the light around (DARNER_AMBIENT_SPECULAR_FILL=1, off by default) #17
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:pr6-specular-fill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
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, themaincommit it was cut from.mainis now4a92569fb. 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-specular-fill) conflicts incrates/darner-gpu/src/ambient.rsonly;README.mdanddraw.rsmerge cleanly. The conflict comes from the "Guard ambient lighting until GPU estimates are ready" change (merged intomainas3b7b6c6e9; the commit isa080db6bb): inwithout_depthit removed the|| !KEPT.load(...)part ofif !bound_asked() || !KEPT.load(...), the same line this branch extends tobound_asked() || fill_asked(). When this is rebased, the resolution isif !(bound_asked() || fill_asked()), without bringingKEPTback.This is a draft. It has not been run in the game by us on any base. Two clippy gates and the policy check passed; the workspace test run was not done (see below).
What this is about. With the reflection estimate on (
DARNER_AMBIENT_SPECULAR), the rays' image of the reflections is written in tiles, and only the miss program writes the tiles of rays that found nothing. When that program is left out (opaque surfaces; on currentmainthat is ray tracing off), those tiles keep bytes of earlier frames: pieces of the picture from other views and black blocks. Glossy surfaces read them as a shimmer that moves with the camera (a fork author's frame capture: a blue bucket, blinds, a counter; 2026-11-28). The estimate along the reflected direction makes its normals from the depth and is itself the grain on floors seen at a grazing angle.New switch:
DARNER_AMBIENT_SPECULAR_FILL=1. Default: not set (off), nothing changes. It acts only withDARNER_AMBIENT_SPECULARset, which is off indarner play's defaults, so by default it changes nothing for anyone. With both on:ambient::without_depth), which gives every texel of the rays' image the light around, without a direction, in place of the estimate along the reflected direction. That light has no direction and no texel of its own, so nothing is left to be ragged;Notes:
ambient::fill_asked()includesDARNER_AMBIENT_SPECULARitself, so this needs no other pull request. The opaque program runs only whenambient::on(Role::Miss)is also true (thesky_miss_left_outcheck israys_found() || (fill_asked() && on(Role::Miss))). It is related to#14: that change makes the opaque program run under the estimate, which is the same as this change's "program runs" half, so with both merged that half is redundant.#14does not do the fill, and the fill works without the program part.draw.rsits early return for the miss role runs whenever the switch is on, without checking whether rays were found, so it also acts with ray tracing on (opaque and transparent layers; water is left out by the layer check). That case is untested.DARNER_RAYMISS_KEEPis not set;KEEPkeeps its meaning.without_depthwas so far reachable only withDARNER_AMBIENT_SPECULAR_BOUND=1; its condition becomes "bound asked or fill asked". Read once (asked_for!inambient::fill_asked). No shader change of the title, so the shader cache key is unchanged.docs/findings.mdentry.Diff against
4db98e011: 4 files (README.md,crates/darner-gpu/src/ambient.rs,crates/darner-gpu/src/draw.rs,docs/findings.md), 2 commits.Credit: a port of the fill in advxrsary's commit
dd8979582(shown as author "advx") in a fork of the project's earlier GitHub repository (a pull request there; that repository is gone, so there is no link). There it was on by default. The same commit also capped a window's share of the room's light in the diffuse stand-in; that is not ported (it changes a default path and would need its own switch and test). The commit message carries aCo-authored-byline.Related earlier reports on CodeFloe (not migrated): lighting jumps with ray tracing off (#82 there), reflections picking up texture colours (#140), and reflection ghosting (#251). They are related, not claimed fixed, so there is no
FixesorRefsline.Spec dependence
DARNER_AMBIENT_SPECULARon, a setting we do not use by default.How it was tested
a55cf8a12(branchpr6-specular-fill, based on4db98e011;mainhas moved, see Base).a55cf8a12):cargo clippy --workspace --all-targets --locked -- -D warnings: passed, without any-Aflag.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed, without any-Aflag.cargo test -p darner-gpu --locked --lib -- --test-threads 1: 1670 passed, 1 failed:watch::tests::ask_once_by_res_splits_reservations_without_refusals(leftSome(125854), rightNone). It passed when run again alone. We call it unconfirmed flaky: we did not runmainfor comparison. This is not the required gate;cargo test --workspace --lockedwas not run. This change adds no unit test of its own.cargo xtask policy: passed.cargo test --workspace --locked; the one failed test above not checked againstmain; everything in the game; the cost (one small pass per dispatch, not measured); whether the fill looks right next to the estimate in the other (non-fill) parts of the picture; AMD and wave64 cards; Series X profile; the branch on currentmain(it conflicts inambient.rs).Checklist
main. (git diff --stat 4db98e011 a55cf8a12: the 4 files above, one change. The branch is on4db98e011, not on currentmain; a trial merge conflicts inambient.rs, see Base. The workspace test gate was not run.)docs/asset-policy.md. (Text only;cargo xtask policypassed ona55cf8a12.)Checked for overlap
host/menu.rs,host/panel.rsandhwrt.rs: none of this change's files. The ambient-guard change that now conflicts (3b7b6c6e9) is already inmain; it also editsambient.rs, so this branch needs a rebase there. Our sibling branches:#14(DARNER_RAYMISS_ESTIMATED; editssky_miss_left_outandambient.rs; textual conflict in one closure; its change is the same as this one's "program runs" half, so whichever merges second needs a rebase),pr6-raymiss-clear(DARNER_RAYMISS_CLEAR, may also conflict textually insky_miss_left_out) andpr6-air-room(editsambient.rsand the same README table).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,crates/darner-gpu/src/draw.rs,docs/findings.md); #15 (README.md,crates/darner-gpu/src/draw.rs,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).
darner rig, F1 AUTO-DETECT row, per-start switches (DARNER_AUTO_SWITCHES, on by default, =0 turns it off) #25WIP: [pr-fix][rendering][lighting] Reflections: the rays' image filled with the light around (DARNER_AMBIENT_SPECULAR_FILL=1, off by default)to [pr-fix][rendering][lighting] Reflections: the rays' image filled with the light around (DARNER_AMBIENT_SPECULAR_FILL=1, off by default)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.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.