DLSS 5 Neural Rendering as an optional module #1116

Open
Dagherbou wants to merge 76 commits from Dagherbou/dlssnr-pr into master
Dagherbou commented 2026-08-29 22:13:59 +00:00 (Migrated from github.com)

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)

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)
ABdelrahmanAlaa1 commented 2026-08-30 00:52:41 +00:00 (Migrated from github.com)

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)

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)
m4tz3hd commented 2026-08-30 01:53:34 +00:00 (Migrated from github.com)

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

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
FakeMichau commented 2026-08-31 14:42:10 +00:00 (Migrated from github.com)

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.

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.
safetycoomer commented 2026-09-01 23:21:50 +00:00 (Migrated from github.com)

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.

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.
Dagherbou commented 2026-09-02 02:06:26 +00:00 (Migrated from github.com)

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.

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.
ABdelrahmanAlaa1 commented 2026-09-05 00:11:25 +00:00 (Migrated from github.com)

Dagherbou did u have any progress on pre dlss SR/RR hooking 👀?

Dagherbou did u have any progress on pre dlss SR/RR hooking 👀?
This pull request has changes conflicting with the target branch.
  • OptiScaler.sln
  • OptiScaler/hooks/Vulkan_Hooks.cpp
  • OptiScaler/inputs/NVNGX_DLSS_Vk.cpp
  • OptiScaler/menu/menu_common.cpp
  • OptiScaler/upscalers/IFeature_Dx11wDx12.cpp
  • OptiScaler/wrapped/wrapped_swapchain.cpp
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 Dagherbou/dlssnr-pr:Dagherbou/dlssnr-pr
git switch Dagherbou/dlssnr-pr

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 master
git merge --no-ff Dagherbou/dlssnr-pr
git switch Dagherbou/dlssnr-pr
git rebase master
git switch master
git merge --ff-only Dagherbou/dlssnr-pr
git switch Dagherbou/dlssnr-pr
git rebase master
git switch master
git merge --no-ff Dagherbou/dlssnr-pr
git switch master
git merge --squash Dagherbou/dlssnr-pr
git switch master
git merge --ff-only Dagherbou/dlssnr-pr
git switch master
git merge Dagherbou/dlssnr-pr
git push origin master
Sign in to join this conversation.
No description provided.