DLSS Ray Reconstruction replacing the in game de-noiser for better quality shadows and reflections #431
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!431
Loading…
Reference in a new issue
No description provided.
Delete branch "paales/ray-reconstruction"
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?
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)
What it changes
CS_TemporalResolve1_Alphais 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):DARNER_RR_HIT=1(off) adds the reflections' hit distance.darner runleaves out the game's own spatial filters for its reflections and shadows, through paths the game has itself (8 code patches inKnownBuild::denoiser_filtersanddenoiser_histories, each checked against its old bytes as the existing patches are):TemporalResolveOpaquein place ofSpatialFilter_Std,SpatialFilterandTemporalResolve2. Blur count 0: noBilateralBlur, noUpdateHistory.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=0leaves out both groups (for tests),1neither. The GI probe filters and the bent cones have no such path and stay.How it was tested
Tested revision:
78655edeplus 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-ignoredmakes 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:
DARNER_TITLE_DENOISERS=0, SR). With the row on the log has "DLSS Ray Reconstruction is ready" and hardware ray tracing on.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):SpatialFilter_Std,SpatialFilter,TemporalResolve2,TemporalResolve1_Alpha,BilateralBlur,UpdateHistoryorDenoiseShadowMaskLDSPacked; 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 --lockedwas 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 onmaintoo.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
main.docs/asset-policy.md.Checked for overlap
[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)to [pr-feature] DLSS Ray Reconstruction replacing the in game de-noiser for better quality shadows and reflectionshttps://drive.google.com/drive/folders/11MO1mXMCcQA_5gkE_PJkbFkOot0Po-gB?usp=sharing See 431 videos. Download for better quality. (and non broken HDR tone mapping :p)
Also check out PR !456
Written by 🤖, results are mine.
Tested on my integration branch, which carries this PR with
DARNER_RR=1on by default: theforgotten669/Darnerintegration/rtx4090@eba6512. 9800X3D, RTX 4090, driver 621.47, 4K, Series X, DLSS Quality, FG 2x, hardware RT.Works: with
sl.dlss_d.dllpresent (DLSS Ray Reconstruction is ready, NGX 310.9.16), the blotches and boiling the main post describes are gone; RT shadows and reflections look clean.Bug: without
sl.dlss_d.dll, RR stays off (no sl.dlss_d.dll in NVIDIA's folder) but the "filters (off with RR)" group is still patched out, so the shadow mask's denoise stage is skipped with nothing in its place and shadows boil badly.run.rsdecides onDARNER_RR=1 && DARNER_DLSS=1at load, before Streamline reports whether RR can start. Suggest patching the filters only once RR is known to be available (e.g. checksl.dlss_d.dll/nvngx_dlssd.dllbeside the interposer), or keeping the row off without them.Tested on Linux under Proton (proton-cachyos), RTX 4080, driver 620.73, Series S profile, DLAA, FG 2x, hardware RT. This PR is merged on top of main
d91d8e4plus a few other PRs in our integration branch.Works here too. With
sl.dlss_d.dllandnvngx_dlssd.dllfrom the Streamline 2.14.1 SDK beside the 2.14.1 interposer, the log saysDLSS Ray Reconstruction is ready(NGX 310.9.1) and thenfirst upscaling recorded in place of DLSS SR(1280x720 to 3840x2160). Window glass reflects the deck and the railing cleanly, without the filter's blocks. Frames took about 41 ms (24 fps, 49 with FG), as they do without RR in that scene.A fix for the bug theforgotten669 found (the filters are patched out even when RR cannot start). We needed it, so here is what we did. Please take it as you like:
crates/darner-gpu/src/streamline.rs: two small public functions. The game and the check resolve the folder the same way.Askeduses the first one fordirin place of its ownvar(...).apps/darner/src/run.rs: the choice inapply_title_patchesmoves into a function. When RR is asked for but its files are missing, the filters stay, with a line in the log.DARNER_TITLE_DENOISERS=0and=1work as before.darnerreaches them through the existingdarner_hle::streamlinere-export, because it does not depend ondarner-gpudirectly.apply_title_patchesthen doeslet (why, lists) = denoiser_lists(build, &switch, rr_asked, &darner_hle::streamline::dir_from_env());and goes on as before.There is a test,
run::denoiser_tests::ray_reconstruction_takes_the_filters_only_with_its_files, that uses a temporary folder. It checks five cases:DARNER_TITLE_DENOISERS=0still patches both lists;DARNER_TITLE_DENOISERS=1patches nothing;It passes under Proton, and so do the
streamline,shader_cacheandmenutests ofdarner-gpu, with three exceptions: threemenutests fail the same way on main in this Wine (font sizes and a process path), so the merge did not cause them. I can open this as a PR against your branch if that is easier.[pr-feature] DLSS Ray Reconstruction replacing the in game de-noiser for better quality shadows and reflectionsto DLSS Ray Reconstruction replacing the in game de-noiser for better quality shadows and reflectionsTest needed — commit
bc729511; what to check:CS_TemporalResolve1_Alphais 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):DARNER_RR_HIT=1(off) adds the reflections' hit distance.darner runleaves out the game's own spatial filters for its reflections and shadows, through paths the game has itself (8 code patches in `KnownBuild::denoiserEvidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.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.