DLSS 5 Neural Rendering as an optional module #1116
No reviewers
Labels
No labels
0.9
3rd party
bug
documentation
duplicate
enhancement
invalid
linux
master
question
undetermined
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
roman/OptiScaler2!1116
Loading…
Reference in a new issue
No description provided.
Delete branch "Dagherbou/dlssnr-pr"
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?
This adds DLSS 5 Neural Rendering to OptiScaler as an optional pass. It runs NVIDIA's nvngx_dlssnr.dll over whatever upscaler you're already using and synthesises detail into the result. It's off by default,
and the model itself isn't included.
The pass runs right after the upscaler, before the game draws its UI.
The colour handling is taken from RenoDX's DLSS 5 addon by clshortfuse, used under its MIT licence. My version first could turn skin green in some scenes;. Their copyright and licence are in Licenses/RenoDX_ATTRIBUTION.txt and the credit is in the shader and the README too. Full credit to them for that part.
There are two sliders that matter. Detail strength is how far the frame moves toward the model's picture, at 0 you get exactly what the upscaler produced. Colour strength decides whether image takes the model's colour. At 0 you keep the game's own colours with the added detail, at 1 you get the model's look.
If you don't want this in the build, set OPTI_DLSSNR to 0 in dlssnr/DlssNr_Switch.h. It compiles out completely.
Everything lives in OptiScaler/dlssnr/. Outside that folder it's eight small #if blocks across four files, and deleting them plus the folder removes it entirely.
There's a small forwarder DLL in the package. It's built here and contains no NVIDIA code.
OptiScaler/dlssnr/README.md has the details, including a few things that cost me device hangs to learn. (clancker wrote it, actual clean up by hand to come)
Could you add an pre-dlss (sr) toggle as that would solve most of the overhead if using dlss perf (but RR is tricky as it handles sr and denoise so I don't think you inject in middle but I might be wrong)
Hi , is there something special to set this up , do I need to run reshade as an Reshade64.dll and set it true in optiscaler ? cuz its not working rn
There are a few things to address.
Is it possible to call dlssnr in the same way that we call dlss? Aka what we have inside NVNGX_Proxy.h.
Basically, you call system-wide nvngx.dll but give the location of all the nvngx_dlss*.dll during init and it then calls those dlls on your behalf when you request a give feature, like nr. That would remove all the forwarder dlls, especially given that we don't use cmake.
Then dlssnr should probably be a class that implements Shader_Dx12, very similar to rcas, os, magnifier etc. Extra resources can be provided on dispatch, while constants using a struct, just like the existing shaders. Up to you how you want to handle the "fake tonmapping" and "untonemapping" - can be inside the DlssNr_Dx12 class, or a separate class that implements Shader_Dx12.
That should also allow you to dispatch the shader from IFeature_Dx12, before upscaling or after upscaling but some handling needs to be added to allow for running shaders before upscaling. The current ShaderPass vector only dispatches shaders after upscaling.
Not sure if you plan on adding support to other backends, but for vulkan it would be nice to see DlssNr_Common for anything that is shared between apis, like constants i would assume.
As for Dx11, the interop upscalers use shaders native to the upscaler itself so if dlssnr doesn't support dx11 then we can later create dlss w/dx12 that would use the dx12 nr so no need to worry about that.
No need for OPTI_DLSSNR if it's implemented in a sensible way.
We talked with Nitec about what's needed, maybe running this filter on present and therefore already being tonemapped. Maybe also using hudfix to create a UI mask.
But the changes i mentioned here should be a good starting point and we can think about expanding in the future, especially when we get some official implementations going, or some official docs.
As implemented, this doesn't work in games using native Dx11 DLSS. You must use FSR2/3 or XeSS since there's no option to use a Dx12-shimmed DLSS in OptiScaler.
If Dx11 support is out of scope that's fine, just putting it somewhere since it appears to be undocumented.
Hello, yes I am aware, vulkan currently works in a similar way through the bridge but this is about to change. For DX11, it will remain this way until I finish some more important elements first. I do believe it is mentioned though in the release notes in the section "DX11 and Vulkan, and the caveats." If this isn't enough you reckon, let me know how you would mention it. Also for fun I did work on an option to use a Dx12-shimmed DLSS but it rendered the image in a worse way than FSR so I might com back to it at a certain point.
Dagherbou did u have any progress on pre dlss SR/RR hooking 👀?
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.