[pr-feature][rendering][lighting][dlss][RAYTRACING][NVIDIA] F1 RAY RECONSTRUCTION: DLSS Ray Reconstruction, with the game's own ray tracing filters off (DARNER_RR=1, off by default) #431

Open
paales wants to merge 7 commits from paales/ray-reconstruction into main AGit
First-time contributor

Written by 🤖:

Refs #66, Refs #109. Replaces #401 (the same denoiser switch, now with Ray Reconstruction and one F1 row; #401 can be closed).

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: DLSS upscales the game's picture after the game's own denoisers have filtered its ray-traced light. Those filters leave blocks, blotches and sparkles in reflections and blur contact shadows, the glass resolve CS_TemporalResolve1_Alpha is dropped on 32-lane hosts (#66) so some glass is dark (the cafe window in the police cutscene), and there is no DLSS Ray Reconstruction (#109).

One F1 row, PICTURE > RAY RECONSTRUCTION (DARNER_RR=1, off by default):

  • DLSS Ray Reconstruction in place of DLSS Super Resolution. Its guides are made from the game's G-buffer by a pass of ours (linear albedo, specular albedo from the game's F0, world-space normals with roughness from its octahedral normals and gloss, the game's own camera); a frame without every guide is upscaled by SR, with the reason in the log. The port is NICKNAMErutschovkonikovan's code from VIctory PRs #3590 and #3854 (GPL-3.0-or-later), fitted to Darner's DLSS recording; DARNER_RR_HIT=1 (off) adds the reflections' hit distance.
  • With it on, darner run leaves out the game's own spatial filters for its reflections and shadows, through paths the game has itself (8 code patches in KnownBuild::denoiser_filters and denoiser_histories, each checked against its old bytes as the existing patches are):
Group Effect Path the game takes
filters (off with RR) Reflections The settings loader writes 0 to the spatial-filter bool: TemporalResolveOpaque in place of SpatialFilter_Std, SpatialFilter and TemporalResolve2. Blur count 0: no BilateralBlur, no UpdateHistory.
filters (off with RR) Shadows The shadow mask's denoise stage (passes 12 to 21, in place) is not called: the lighting reads the traced mask.
histories (kept with RR) Reflections, GI History length 1 and the frame setup's camera-cut path every frame.

The histories stay with RR: without them the GI's screen probes and the reflections change every frame in patches, and the picture boils in motion, with SR and with RR. DARNER_TITLE_DENOISERS=0 leaves out both groups (for tests), 1 neither. The GI probe filters and the bent cones have no such path and stay.

How it was tested

  • Tested revision: 78655ede plus the docs commit on top (no code change after the build that was played).

  • Commands and results: see the gates line. cargo test -p darner-gpu --lib menu -- --include-ignored makes the picture of the new row (DARNER_MENU_SHOT).

  • Changes a default: no. RAY RECONSTRUCTION is off by default, and nothing changes for a player who does not turn it on.

  • How the off-by-default row was checked, in the game, RTX 5070 Ti, Series X profile, 3840x2160 output, DLSS Performance, hardware ray tracing:

    • Played on this revision, house save and night parking lot, three ways from the same save: RR (the row), the game's own denoisers (SR), and no denoising at all (DARNER_TITLE_DENOISERS=0, SR). With the row on the log has "DLSS Ray Reconstruction is ready" and hardware ray tracing on.
    • Measured on an older base with the same patches through DARNER_TITLE_PATCH (one run each way, static view 16 to 30 s, change between captures 500 ms apart, 0 to 255, both groups out):
    A (denoisers on) B (both groups out)
    SR: bush shadow on a pillar, change between captures 1.81 4.01
    RR: the same shadow 1.61 2.29
    • The dispatch capture with both groups out has no SpatialFilter_Std, SpatialFilter, TemporalResolve2, TemporalResolve1_Alpha, BilateralBlur, UpdateHistory or DenoiseShadowMaskLDSPacked; none of them is among the 60 most costly pipelines (DARNER_CARD_METER_PIPELINES=1, 0.06 ms a frame each at most). RR takes 1 to 2 ms a frame more card time than SR; the frame rate does not change.
  • Gates run on this revision: both clippy gates pass. cargo test --workspace --locked was not run to the end on this revision; on the denoiser commit alone it had 2117 passed and 1 failed, a write-watch test that fails now and then on main too.

  • Shader wave sizes tested: 32 lanes.

  • Hardware dependence: RR needs an NVIDIA card with DLSS; the patches are in the game's own code. The dark glass needs a 32-lane host (#66).

  • Coverage gaps: AMD, Intel and Series S not tested. The final RR setting (filters out, histories kept) was checked by play, not by a measured run. The cafe glass result was measured with both groups out.

Pictures (cropped from 3840x2160 captures) follow in a comment.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • 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: #80 (DLSS 5 neural rendering, the same Streamline code), #9, #12 and #16 (rows on the same F1 page), #328 (F1 menu clicks), #14, #15 and #17 (reflection fixes in other code).
  • Replaces or overlaps: #401 (the denoiser switch alone, without RR; this one replaces it).
_Written by 🤖:_ Refs #66, Refs #109. Replaces #401 (the same denoiser switch, now with Ray Reconstruction and one F1 row; #401 can be closed). ## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: DLSS upscales the game's picture after the game's own denoisers have filtered its ray-traced light. Those filters leave blocks, blotches and sparkles in reflections and blur contact shadows, the glass resolve `CS_TemporalResolve1_Alpha` is dropped on 32-lane hosts (#66) so some glass is dark (the cafe window in the police cutscene), and there is no DLSS Ray Reconstruction (#109). One F1 row, PICTURE > RAY RECONSTRUCTION (`DARNER_RR=1`, off by default): - DLSS Ray Reconstruction in place of DLSS Super Resolution. Its guides are made from the game's G-buffer by a pass of ours (linear albedo, specular albedo from the game's F0, world-space normals with roughness from its octahedral normals and gloss, the game's own camera); a frame without every guide is upscaled by SR, with the reason in the log. The port is NICKNAMErutschovkonikovan's code from VIctory PRs #3590 and #3854 (GPL-3.0-or-later), fitted to Darner's DLSS recording; `DARNER_RR_HIT=1` (off) adds the reflections' hit distance. - With it on, `darner run` leaves out the game's own spatial filters for its reflections and shadows, through paths the game has itself (8 code patches in `KnownBuild::denoiser_filters` and `denoiser_histories`, each checked against its old bytes as the existing patches are): | Group | Effect | Path the game takes | |---|---|---| | filters (off with RR) | Reflections | The settings loader writes 0 to the spatial-filter bool: `TemporalResolveOpaque` in place of `SpatialFilter_Std`, `SpatialFilter` and `TemporalResolve2`. Blur count 0: no `BilateralBlur`, no `UpdateHistory`. | | filters (off with RR) | Shadows | The shadow mask's denoise stage (passes 12 to 21, in place) is not called: the lighting reads the traced mask. | | histories (kept with RR) | Reflections, GI | History length 1 and the frame setup's camera-cut path every frame. | The histories stay with RR: without them the GI's screen probes and the reflections change every frame in patches, and the picture boils in motion, with SR and with RR. `DARNER_TITLE_DENOISERS=0` leaves out both groups (for tests), `1` neither. The GI probe filters and the bent cones have no such path and stay. ## How it was tested - Tested revision: 78655ede plus the docs commit on top (no code change after the build that was played). - Commands and results: see the gates line. `cargo test -p darner-gpu --lib menu -- --include-ignored` makes the picture of the new row (`DARNER_MENU_SHOT`). - Changes a default: no. RAY RECONSTRUCTION is off by default, and nothing changes for a player who does not turn it on. - How the off-by-default row was checked, in the game, RTX 5070 Ti, Series X profile, 3840x2160 output, DLSS Performance, hardware ray tracing: - Played on this revision, house save and night parking lot, three ways from the same save: RR (the row), the game's own denoisers (SR), and no denoising at all (`DARNER_TITLE_DENOISERS=0`, SR). With the row on the log has "DLSS Ray Reconstruction is ready" and hardware ray tracing on. - Measured on an older base with the same patches through `DARNER_TITLE_PATCH` (one run each way, static view 16 to 30 s, change between captures 500 ms apart, 0 to 255, both groups out): | | A (denoisers on) | B (both groups out) | |---|---|---| | SR: bush shadow on a pillar, change between captures | 1.81 | 4.01 | | RR: the same shadow | 1.61 | 2.29 | - The dispatch capture with both groups out has no `SpatialFilter_Std`, `SpatialFilter`, `TemporalResolve2`, `TemporalResolve1_Alpha`, `BilateralBlur`, `UpdateHistory` or `DenoiseShadowMaskLDSPacked`; none of them is among the 60 most costly pipelines (`DARNER_CARD_METER_PIPELINES=1`, 0.06 ms a frame each at most). RR takes 1 to 2 ms a frame more card time than SR; the frame rate does not change. - Gates run on this revision: both clippy gates pass. `cargo test --workspace --locked` was not run to the end on this revision; on the denoiser commit alone it had 2117 passed and 1 failed, a write-watch test that fails now and then on `main` too. - Shader wave sizes tested: 32 lanes. - Hardware dependence: RR needs an NVIDIA card with DLSS; the patches are in the game's own code. The dark glass needs a 32-lane host (#66). - Coverage gaps: AMD, Intel and Series S not tested. The final RR setting (filters out, histories kept) was checked by play, not by a measured run. The cafe glass result was measured with both groups out. Pictures (cropped from 3840x2160 captures) follow in a comment. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [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: #80 (DLSS 5 neural rendering, the same Streamline code), #9, #12 and #16 (rows on the same F1 page), #328 (F1 menu clicks), #14, #15 and #17 (reflection fixes in other code). - Replaces or overlaps: #401 (the denoiser switch alone, without RR; this one replaces it).
Author
First-time contributor
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/darner-gpu/src/host/menu.rs
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 origin '+refs/pull/431/head:paales/ray-reconstruction'
git switch 'paales/ray-reconstruction'

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 'paales/ray-reconstruction'
git switch 'paales/ray-reconstruction'
git rebase 'main'
git switch 'main'
git merge --ff-only 'paales/ray-reconstruction'
git switch 'paales/ray-reconstruction'
git rebase 'main'
git switch 'main'
git merge --no-ff 'paales/ray-reconstruction'
git switch 'main'
git merge --squash 'paales/ray-reconstruction'
git switch 'main'
git merge --ff-only 'paales/ray-reconstruction'
git switch 'main'
git merge 'paales/ray-reconstruction'
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!431
No description provided.