emoose / DLSSTweaks

Tweak DLL for NVIDIA DLSS, force DLAA on DLSS-supported titles, tweak scaling ratios & DLSS 3.1 presets, override DLSS versions without overwriting game files.
MIT License
1.23k stars 20 forks source link

DLSS 3.5 Ray Reconstruction #90

Open PweSol opened 1 year ago

PweSol commented 1 year ago

So, Nvidia has just announced DLSS Ray Reconstruction. It seems like this feature cannot be retrofitted in the same way as we are doing with DLSS 2 (hot-swapping dll versions). However, I see a potential use case for DLSSTweaks with this new DLSS version.

Nvidia informed reviewers that ray reconstruction won't work at native/DLAA(?), as it is part of the upscaling process of DLSS. This got me thinking that we could potentially circumvent this by forcing DLSS 3.5 to render at 99% resolution (for example).

Though I fail to understand why this ray denoising pass shouldn't work at 100% scale, since DLAA is literally just DLSS. Hopefully, it is just a miscommunication, and Nvidia meant something slightly different. My guess is that they meant Ray Reconstruction isn't a separate feature like Frame Generation or Reflex (which makes sense), but a part of DLSS Upscaling that cannot be turned on/off when implemented in the pipeline (which also makes sense). As such, it would work like DLAA (DLSS at 100% scale). Correct me if my thinking is wrong.

Either way, I hope DLSSTweaks can still be used in the future with DLSS 3.5.

emoose commented 1 year ago

E: table of the current DLSSD/RR DLL versions:

Version number CL revision PE TimeDateStamp Download Source
3.7.0.0-dev 33860605-dev 2024-02-05 https://pixeldrain.com/u/bBUshJkL (dev/watermarked build) The First Descendant
3.7.0.0 33812812 2024-01-26 https://www.techpowerup.com/download/nvidia-dlss-3-ray-reconstruction-dll/ Portal with RTX
3.5.10.0 33457773 2023-10-26 https://reddit.com/r/nvidia/comments/17xzlc2/_/k9twb0t/ Alan Wake 2
3.5.0.0 33367307 2023-10-05 https://pixeldrain.com/u/mSc2ZnMd Alan Wake 2(*)
3.5.0.0 33284283 2023-09-11 https://pixeldrain.com/u/bnEC16NA CP2077 2.01
3.5.0.0 33263601 2023-09-05 https://pixeldrain.com/u/EoVFQRwa CP2077 2.0

(*): AW2 also included newer v3.5.0.0 DLSS & DLSSG DLLs, both CL33358127 2023-10-03 (newer than the other v3.5.0.0 DLLs available), for convenience I've uploaded them here: https://pixeldrain.com/u/ZKWZB4YX - note that these are older than the v3.5.10 DLLs that were posted recently, but are newer than any other known 3.5.0.0 DLL.


Previous post:

Yeah hoping they just mean SuperRes is required for RR to function, and by "won't work at native" they just meant SR-disabled, can't think of why DLAA/1.0x scale shouldn't work with it, doesn't require anything more than the other DLSS modes use anyway.

Like you mentioned I'd guess it's probably tied to the super-res in some way, maybe works as part of it, or just requires tapping into the same kind of buffers it uses.

In worst case I guess we could probably use 0.99x scale like you said, that did help with some other games that have DLAA issues before too.

Just hoping they publish a proper SDK for RR this time, and not some closed-source Streamline plugin like FG was released as, if it does work as a denoiser it might be possible to write replacement denoiser plugins for older games to make use of it.
(eg. a NRD.dll wrapper for games that use NV's old denoiser, and I think UE4/UE5 support loading denoisers as plugin DLLs if they export the right functions, but might be thinking of a different engine), though the super-res requirement could make that a bit trickier.

emoose commented 1 year ago

DLSS & DLSS-FG were updated to v3.5

nvngx_dlss.dll v3.5 (CL 33190482): https://github.com/NVIDIA/DLSS/raw/83e10e77c8ea0bd7ac8c4884c1aa4facad5910c2/lib/Windows_x86_64/rel/nvngx_dlss.dll

nvngx_dlssg.dll (watermarked): https://media.githubusercontent.com/media/NVIDIAGameWorks/Streamline/fef96c6aed1089f3dfcbfbd714afcaf5100979ee/bin/x64/nvngx_dlssg.dll

The NV dev site also had some slightly more updated versions, there's a nvngx_dlss.dll v3.5 with slightly higher CL 33199489 (https://pixeldrain.com/u/2sbdhpwE), and also included a non-watermarked dlssg DLL (https://pixeldrain.com/u/XkbtyC4B)

You can check signature inside file properties for those, both should show signed by NV.


NV dev site also released a UE5 plugin which contains SDK header files for DLSSD, which seems to be Ray Reconstruction, but without any DLL for it it's not usable atm - at least it looks like it is being handled the same way as DLSS with a proper SDK instead of using a closed-source Streamline plugin.

From quickly looking at those headers it seems DLSSD is inited almost the same as DLSS itself is, with game telling DLSSD a quality level to use, and DLSSD returning the output resolution for game to render at - could mean DLSSD actually replaces DLSS itself, not too sure about that yet though (EDIT: some comments from NV devs to DF etc seem to confirm this, saying that SR + RR are merged as a single model, likely also means they're both handled via the single DLSSD DLL too)


(E: about the v1/v2 DLLs that have been mentioned on other sites: the "v1" 3.5 DLL is the first one I linked from github, while "v2" 3.5 is the pixeldrain one from NV dev site which has a higher CL - from what I've checked there's not really any difference between them other than CL being increased, the higher-CL version comes from NV's demo app which probably gets built some time after the main DLSS plugin, after CL number has increased, guess it must also rebuild DLSS itself since demo app always seems to have a unique CL DLL included with it)


E: for anyone interested in Ray Reconstruction, /u/rerri on reddit dug up a readme that was included in the NV fork of UE5: https://github.com/NvRTX/UnrealEngine/blob/nvrtx-5.2/Engine/Plugins/Runtime/Nvidia/DLSS/README.md (you may need access to EpicGames/UnrealEngine repo to access it)

Readme is mostly UE specific but gives some details about it - the UE5 plugin code there also makes use of DLSSD and shows how it gets inited & updated too, could be useful for those who want a head start on implementing it.

itsdinkd commented 1 year ago

so is this compatible with 3.5?

emoose commented 1 year ago

@itsdinkd should mostly work fine, can still customize the quality level ratios with it, there might be some issues with it selecting wrong DLSS model/preset than what you picked though, but if you change all the entries in the [DLSSPresets] section to the same letter (A - F) then hopefully that'll let it get forced, will need to take another look at it soon.

emoose commented 1 year ago

Ray Reconstruction was released with CP2077 & Chaos Vantage, looks like both of them use the same nvngx_dlssd.dll v3.5, some reason CP2077 is using DLSS 3.1.1 & DLSS-FG 3.1.13 with it though instead of updating them all to 3.5, odd.

Chaos Vantage uses same 3.5 ver for both DLSSD & normal DLSS, so guess it doesn't depend on exact version of DLSS or anything like that - DLSS & DLSSG files match the ones we already have too, so just the DLSSD is new.

Here's nvngx_dlssd.dll for anyone interested (check nvidia signature in file properties): https://pixeldrain.com/u/EoVFQRwa

I still need to redownload CP fully to test with it, Chaos Vantage has a free trial which should be able to make use of it too, there's also the NvRTX UE5 fork (requires EpicGames/UnrealEngine repo access) that includes code to use DLSSD, guessing that should work now that we have the DLL.

PweSol commented 1 year ago

I'm testing it right now. CP2077 doesn't allow you to use DLAA and RR at the same time. However, you can use it with any quality preset for DLSS. The workaround of forcing 99% scale should work (needs more testing). Nvidia stated RR is trained for DLSS Quality specifically. I can confirm it has way more issues at lower presets than with Quality (and higher scales if it works). It's possible the bugs it has are due to the way CDPR implemented it in CP2077. Other implementations might not have them.

emoose commented 1 year ago

Could you check if the global NvProfile settings work with it? It looks like dlssd DLL is still checking them but not sure if they're actually getting used. (configtool from https://github.com/emoose/DLSSTweaks/issues/85#issuecomment-1724544141 should let you change them, just run the EXE without any dlsstweaks.ini in the same folder, or use NvProfileInspector with the XML from https://github.com/Orbmu2k/nvidiaProfileInspector/issues/156#issuecomment-1661197267)

AFAIK the reg file from https://github.com/emoose/DLSSTweaks/blob/master/external/ngx_driver_onscreenindicator_all.reg should let it display some kind of overlay too, not sure if the resolutions are shown there though.

doktorsleepelss commented 1 year ago

This is what the overlay shows. H6f48gl

doktorsleepelss commented 1 year ago

An interesting thing is that the upscaling part of the RR model can stay on even if you turn off path tracing and use regular rasterization. (can confirm with the overlay) Lights seem to shine brighter.

EDIT: Without path tracing, I noticed more moire instability with the RR model, but the ghosting is reduced on the street lamps.

emoose commented 1 year ago

Could you check if the global NvProfile settings work with it? It looks like dlssd DLL is still checking them but not sure if they're actually getting used.

Ah it turned out the DLSS 3.1.1 that CP2077 still includes for some reason is from before they added the NvProfile stuff, so the profile settings have no effect, easy fix -> switch out nvngx_dlss.dll for DLSS 3.5:

23-09-22_17-21-04-425_Cyberpunk2077

A little strange that DLSSD is dependant on the resolution used by DLSS-SR though, since it looked like DLSSD was meant to handle DLSS-SR itself (all the models like crimson_slug etc seem included inside DLSSD)...

Seems both nvngx_dlss & nvngx_dlssd modules are loaded into the process at the same time, too bad since I was hoping the current DLSSTweaks code for nvngx_dlss could have been reused, but guess I might have to duplicate it so it can handle both at once instead.


E: actually it looks like we can just continue applying to nvngx_dlss and the tweaked scale will be applied to DLSSD automatically, neat. Looks like a lot of people have had issues with tweaks breaking denoisers / RR though, which I haven't been able to make happen on my side yet...

If anyone is currently having issues using tweaks with it, could you try using the beta4 build from https://github.com/emoose/DLSSTweaks/issues/85#issuecomment-1720404754, and try renaming the DLL to dxgi.dll first? (It didn't seem to load in as nvngx.dll for me, for whatever reason...)

emoose commented 1 year ago

Added a hook to let the DLSSD hud be overridden, so OverrideDlssHud INI setting should apply to DLSSD now too, heard some people mention using that setting had caused weird glitches with RR before but never saw that on my side, maybe was something to do with DLSS hud being active while DLSSD was inactive or something like that, hopefully this might help with it.

With that I /think/ RR should be mostly fully supported now, only thing remaining is hooks for the built-in SR stuff inside DLSSD, not too sure if that SR code is ever actually used though, most signs point to it going through nvngx_dlss instead.

Will post up a release for 0.200.8 shortly after a little more testing.

EDIT: Posted changelog at https://github.com/emoose/DLSSTweaks/releases/tag/0.200.8.1 Download can be found at https://www.nexusmods.com/site/mods/550?tab=files

emoose commented 12 months ago

CP2077 2.01 update seems to have updated the dlssd DLL too (for Ray Reconstruction), version number is the same but CL revision was increased.

Heard some mention they're getting better IQ from it but haven't really seen much proof of that yet, might be interesting to try comparing results from old vs new.

I've updated my reply above (https://github.com/emoose/DLSSTweaks/issues/90#issuecomment-1689118267) with a table of the current DLSSD versions, will try and keep that updated as more DLLs show up.

emoose commented 11 months ago

DLSS/DLSSG 3.5.10 was released earlier, posted about them at https://www.reddit.com/r/nvidia/comments/17afa5t/dlss_super_resolution_sdk_3510_released_nvngx/k5cijlr/, the github dlssg is watermarked but linked a non-watermarked ver there too.

Sadly no DLSSD 3.5.10, even though UE plugin contains the SDK/code to use it I guess NV are still keeping it close for now (a shame since I've already seen a bunch of open-source projects that hope to use it...), maybe some game update will include it eventually.

emoose commented 11 months ago

Alan Wake 2 includes a newer DLSSD v3.5, CL33367307 (2023-10-05), size is a bit bigger than the CP2077 versions too, but version number was unchanged, updated table above.

E: also includes a newer v3.5.0.0 nvngx_dlss.dll & nvngx_dlssg.dll, both CL33358127 2023-10-03, newer than the other v3.5.0.0 DLLs, but older than the v3.5.10.0 version that I'd linked above.

Still need to check CP2077 2.02 update, if anyone has that downloaded could you check file properties of the DLSS files and see what CL is mentioned?

jlouis commented 11 months ago

CP2077 2.02 has the same CL as 2.01.

doktorsleepelss commented 11 months ago

This new dlssd dll gives a huge performance boost to both cyberpunk and alan wake 2 with path tracing. In cyberpunk, I went from 16 fps to 28 fps in once scene I checked.

I haven't studied picture quality yet though.

EDIT: fuck, false alarm. Think it was just taking a while for cyberpunk to get up to full performance. Happens sometimes.

emoose commented 10 months ago

Seems latest AW2 patch included 3.5.10 DLSSD, so now we can complete the 3.5.10 set 🐱 https://www.reddit.com/r/nvidia/comments/17xzlc2/dlssg_ray_reconstruction_35100_33457773_alan_wake/k9twb0t/

I don't have AW2 downloaded anymore to check the other DLLs, any chance someone could check file properties of nvngx_dlss.dll & dlssg.dll to see if CL number listed is any different to the latest 3.5 / 3.5.10.0 DLLs that we know about? (CL33396148 for 3.5.10.0 or CL33358127 for 3.5.0.0)

Lewison78 commented 4 months ago

I have downloaded the First Descendant open test server, it has a 3.7.0 DLSSD file, with cl revision of 33860605, would you like me to upload the file?

Lewison78 commented 4 months ago

I have downloaded the First Descendant open test server, it has a 3.7.0 DLSSD file, with cl revision of 33860605, would you like me to upload the file?

update: after putting it in portal rtx, and using dlsstweaks option to remove watermark, the watermark in question still remains

emoose commented 4 months ago

Oh interesting, if you can upload it I'll try taking a look, if that has watermark I guess it could be a dev version of it? Don't think we've seen one of those for DLSSD yet.

Lewison78 commented 4 months ago

Oh interesting, if you can upload it I'll try taking a look, if that has watermark I guess it could be a dev version of it? Don't think we've seen one of those for DLSSD yet.

https://we.tl/t-pgMtZm22zB here you go, uploaded it to WeTransfer, since i dont know how to upload DLL files to github lol

emoose commented 4 months ago

Yep looks like it's dev ver, thanks for letting us know - do you know if the DLSS hud shows anything different with it? will have to grab a dlssd game to check soon.

The 33860605 CL and build date match up to DLSS 3.7.0.0 as well, maybe the other DLSSD 3.7 with earlier CL is actually some kind of pre-release (think that DLSSD was the first DLL we had that was v3.7)

Guess there should also be a non-dev ver for 33860605 too, maybe the first descendant devs will push an update with it eventually.

Until then you can probably just replace it with the earlier 3.7 DLL, there's only about ~10 days difference in build date with them, probably not much different.

or if game doesn't have anticheat you could try using cheat engine to search for %s SDK - DO NOT DISTRIBUTE and change it to empty string, that's pretty much what DLSSTweaks does to remove it.

Lewison78 commented 4 months ago

Yep looks like it's dev ver, thanks for letting us know - do you know if the DLSS hud shows anything different with it? will have to grab a dlssd game to check soon.

The 33860605 CL and build date match up to DLSS 3.7.0.0 as well, maybe the other DLSSD 3.7 with earlier CL is actually some kind of pre-release (think that DLSSD was the first DLL we had that was v3.7)

Guess there should also be a non-dev ver for 33860605 too, maybe the first descendant devs will push an update with it eventually.

Until then you can probably just replace it with the earlier 3.7 DLL, there's only about ~10 days difference in build date with them, probably not much different.

or if game doesn't have anticheat you could try using cheat engine to search for %s SDK - DO NOT DISTRIBUTE and change it to empty string, that's pretty much what DLSSTweaks does to remove it.

sorry for the late reply, but the HUD does not show anything interesting except the "juicypenguinsm86" Portal with RTX Screenshot 2024 05 28 - 14 39 08 42

Lewison78 commented 4 months ago

Portal with RTX Screenshot 2024 05 30 - 17 21 43 92 i have found a dlssd 3.7 cl33860605 non dev version (does not have the watermark), i shall upload it right here https://pixeldrain.com/u/xTZctWKd D5 render is the source btw. I will download chaos vantage next to see if it also uses the same dlssd file Zrzut ekranu 2024-05-30 172656 forgive me for the weird looking letters, unfortunately im polish update: chaos vantage uses the same cl version as d5 render

Lewison78 commented 3 months ago

dlssd v3.7.10.0 cl34201261 source: the first descendant file preload https://pixeldrain.com/u/Kq8CoNLU