[pr-fix][rendering][lighting] Reflections: the opaque miss program runs under the reflection estimate (DARNER_RAYMISS_ESTIMATED=1, off by default) #14
Loading…
Reference in a new issue
No description provided.
Delete branch "Jesper-A/Darner:pr6-raymiss-estimated"
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-raymiss-estimated) merges cleanly: no conflicts.This is a draft. It has not been run in the game by us on any base.
What this is about. The reflections' "missed everything" program (the miss program) is left out for opaque surfaces when the title's rays find nothing to hit, which on current
mainmeans ray tracing off (sky_miss_left_outindraw.rs; an earlier CodeFloe PR, #309 there, not migrated, made it run when rays are found; that change is inmain). It is left out for the sky light it gives each ray: a white grain on floors seen at a grazing angle. Leaving it out has a cost: the texels no screen-space pass resolves keep earlier frames' bytes, and the reflections feed them back frame after frame (the half-size reflection image is resolved from the frame before). A fork's frame capture showed colour noise over a convex mirror and glowing blue patches on a cell floor from that, and its run with the program kept had a clean mirror, floor and glass.With the reflection estimate on (
DARNER_AMBIENT_SPECULAR), the sky light the program gives is replaced by the estimate along the reflected direction, so the cause of the grain is gone, and there is less reason to leave the program out.New switch:
DARNER_RAYMISS_ESTIMATED=1. Default: not set (off), nothing changes. With1andDARNER_AMBIENT_SPECULARset, the opaque layer's dispatches of the miss program run while the reflection estimate follows them. WithoutDARNER_AMBIENT_SPECULARit does nothing.DARNER_AMBIENT_SPECULARis off indarner play's defaults, so by default this switch changes nothing for anyone.main: it needs no other pull request.DARNER_RAYMISS_KEEPis not set.KEEPkeeps its meaning and wins when set.ambient::specular_on()(isDARNER_AMBIENT_SPECULARset) together withambient::on(Role::Miss). The original asked only the second, whichDARNER_AMBIENTalone also makes true; that would have turned it on for people without the reflection estimate.miss_left_out(keep, estimated), with a unit test (miss_tests). Read once (asked_for!). No shader change, 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 BaRian29's commit
5c212d21bin 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 whenever the estimate was. The commit message carries aCo-authored-byline.No upstream issue covers this, so there is no
FixesorRefsline.Spec dependence
DARNER_AMBIENT_SPECULARon, a setting we do not use by default, and ray tracing off.How it was tested
e8f3642db(branchpr6-raymiss-estimated, based on4db98e011;mainhas moved, see Base).cargo clippy --workspace --all-targets --locked -- -D warningswith-A clippy::unnecessary_lazy_evaluationsadded: 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.darner-gpu, full library: one test failed,watch::tests::ask_once_by_res_splits_reservations_without_refusals(once alsowatch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs). It is in a test file this change does not touch and it passes when run alone. We did not runmainfor comparison, so we do not know whether it is flaky or an old failure.cargo test --workspace --lockedas one command was not run. The newmiss_testsare part of thedarner-gpulibrary tests.cargo xtask policy: passed.Checklist
main. (git diff --stat 4db98e011 e8f3642db: the 4 files above. The branch is on4db98e011, not on currentmain; a trial merge is clean, see Base.)docs/asset-policy.md. (Text only;cargo xtask policypassed.)Checked for overlap
host/menu.rs,host/panel.rsandhwrt.rs: none of this change's files. Our sibling branchespr6-raymiss-clear(DARNER_RAYMISS_CLEAR) andpr6-specular-fill(DARNER_AMBIENT_SPECULAR_FILL) also editsky_miss_left_out, and withpr6-air-roomall add a row and bump the setting count in the README's "Lighting and ray tracing" table. The fill branch and this one conflict textually in one closure ofsky_miss_left_outif both merge. Earlier reports on CodeFloe (not migrated) about lighting jumps with ray tracing off, reflections picking up texture colours and reflection ghosting are related, not claimed fixed.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). #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 opaque miss program runs under the reflection estimate (DARNER_RAYMISS_ESTIMATED=1, off by default)to [pr-fix][rendering][lighting] Reflections: the opaque miss program runs under the reflection estimate (DARNER_RAYMISS_ESTIMATED=1, off by default)An in-game check of this PR's behaviour, at the convex mirror the description mentions: the ceiling-corner dome mirror in the first prison cell (above the lockers, by the window, the prologue's first free walk). With the opaque miss program kept and the estimate on, the mirror's speckle is gone.
How: on the v2026.12.03.01 release
darner.exe, not a build of this branch. With ray tracing off,DARNER_AMBIENT_SPECULARset andDARNER_RAYMISS_KEEPunset, this PR'smiss_left_out(None, || true)keeps the program. That's the same decision asDARNER_RAYMISS_KEEP=1on the release, so I ran that.PC: RTX 4080 16 GB (driver 32.0.16.1742), Ryzen 9 7900, 32 GB, Windows 11 Home 26200. Settings: Series X, 4K output, DLSS Performance, frame generation 2x. Four runs from the same save (opening cinematic, then the cell), each looking up at the mirror with the camera still; one setting changed per run in
darner-settings.txt:AMBIENT_SPECULARRAYMISS_KEEP1(as F1 saved it)175 directional passes recorded after CS_RayMiss (surfaces: alpha)per 10 s11409 directional passes recorded after CS_RayMiss (surfaces: opaque, alpha)per 10 s1So on this card the speckle comes with the opaque miss program left out, with or without the estimate (runs 1 and 2), and keeping it under the estimate clears it (run 3), as the fork's capture described. The mirror then shows the estimate, not the room (run 4 is what it should look like); that's expected for a stand-in, just noting it.
Not checked: the white grain on floors at a grazing angle. I glanced at the cell floor in run 3 and saw a few small white flecks, but I have no same-view comparison without the switch, so I can't say whether that's the grain or the floor's own debris. No other area, no frame-time comparison.
One thing for the description: on v2026.12.03.01, F1's quality presets above the lowest set
DARNER_AMBIENT_SPECULAR=1(crates/darner-gpu/src/host/menu.rs485-491), and my saved settings had it on. So for people who picked a preset in F1, the estimate is on, and this switch would change something for them if it became the default.Attached: the four play logs (user and PC names removed). The mirror was on screen in each at, for the logs: run 1 00:33:05, run 2 00:43:54, run 3 00:49:42, run 4 00:39:25 UTC.
Review (read only, not run in the game):
DARNER_RAYMISS_KEEPstill wins. The puremiss_left_out()with a test is good.ambient()finds no depth. Worth a look in a run.KEEP=1support the mirror fix. A run of this branch itself, and a check of the floor grain, would settle it.Ready to merge after the rebase.
e8f3642dbdto3988a449beRebased onto main
f899d8cffand force-pushed; the head is now3988a449b. The only conflict was docs/findings.md: main's lines kept, our section last.Gates on
3988a449b:cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.cargo test --workspace --no-fail-fast: everything passes except 4 darner-shader GPU/DXIL tests (barycentric_tests::first_half_values_render_on_hardware_and_warp, rect x2, waterfallsampled_marks). This diff does not touch them; they also failed in earlier runs on other branches (barycentric and rect x2 on one, plus waterfallsampled_markson another). Not re-run on main for this check.Still open, as in the review: the first frames after loading (POINTS_READY), the cost (409 vs 175 directional passes per 10 s) and the floor grain. No in-game run of this branch yet.
This comment was written with AI assistance (Claude Code).
Re-review of
3988a449(read only, not built or run): the code changes are the same as the version reviewed before. Only the findings.md conflict was resolved, and it now merges cleanly with main. The rebase was the one blocker, so this is ready to merge.Two notes for testers: the stand-in skips its first frames after loading until the estimates exist, and no frame-time A/B has been done yet (about double the directional passes in Trillazill's log). A run of this branch itself, checking the floor grain, would still be welcome.
tested #14 (DARNER_RAYMISS_ESTIMATED=1) on 03.02, series-s settings, RT off, AMBIENT_SPECULAR=1
paint on the truck is way better, plain 0302 had heavy blocky speckles, with #14 theres only a faint fine speckle on the lower side panel / sill when you get up close
floors not grainy, no sky flash after loading
log confirms it ran: plain log has "reflections' miss program left out", pr14 log has none
frame times about the same, free play not the same route so take it with salt:
plain 14.5 fps median (12.4 slowest 10%), #14 13.7 (11.9)
prep 39.8 -> 31.5 ms median, gpu 7.5 -> 8.3 ms median (the extra miss pass i guess)
so no real cost i can see, the difference is within noise
logs attached
View command line instructions
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.