Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVIDIA DLSS (Deep Learning Super Sampling) #8420

Open
JMS55 opened this issue Apr 17, 2023 · 6 comments
Open

NVIDIA DLSS (Deep Learning Super Sampling) #8420

JMS55 opened this issue Apr 17, 2023 · 6 comments
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible

Comments

@JMS55
Copy link
Contributor

JMS55 commented Apr 17, 2023

What problem does this solve or what need does it fill?

We already have TAA. DLSS takes temporal rendering a step further, and renders at a lower resolution and then upscales it over time. This can be a huge performance increase when the cost of shading a pixel is very expensive, such as in per-pixel ray/path tracing.

What solution would you like?

Integrate DLSS as an optional anti-aliasing method, completing our existing MSAA, FXAA, TAA options.

Current Progress

Problems

  • Quality seems bad/wrong - there's heavy aliasing even at 4k quality mode. I'm not sure why.
  • There's a crash when enabling one of the ultra quality/performance modes (I forget which).
  • Currently using DLSS requires disabling pipelined rendering, due to non-thread safety of the DLSS SDK. I need to figure out how to get around this.
  • I haven't setup support (in either dlss_wgpu or bevy) for DLSS A-F presets (different from the quality/performance modes).
  • Only Vulkan is supported, and not yet DirectX12.

What alternative(s) have you considered?

DLSS is NVIDIA only, and closed-source. FSR (#5232) is an alternative option from AMD that works on more GPUs and is open-source. There's also XeSS from Intel. For macOS, the only option is MTLFXTemporalScaler.

I've looked into integrating FSR but ran into difficulties. I haven't bothered looking into XeSS or MTLFXTemporalScaler.

@JMS55 JMS55 added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen labels Apr 17, 2023
@alice-i-cecile
Copy link
Member

I'd prefer to prioritize a cross-hardware compatible algorithm in Bevy itself: we should just make sure that a third-party DLSS crate can interop cleanly.

@JMS55
Copy link
Contributor Author

JMS55 commented Apr 17, 2023

I'd prefer to prioritize a cross-hardware compatible algorithm in Bevy itself: we should just make sure that a third-party DLSS crate can interop cleanly.

Me too, but I couldn't get FSR working. It would require deep wgpu changes around texture state tracking in order to work. That, or maybe a custom fork of FSR. I'm not sure what the solution would be. That's why I've shifted focus towards DLSS.

That said, I'd like to support all options in bevy, out of the box. In the future we could have a TemporalBundle that tries DLSS, FSR, XeSS, MTLFXTemporalScaler, TAA, choosing the best one or falling back if not supported on the current platform.

@duplexsystem
Copy link

duplexsystem commented Apr 18, 2023

I do not think adding integration of proprietary software in bevy (i.e. any proprietary software which a game must ship as opposed to just linking to it) out of the box (or even behind an cargo option) is the right call.

@PROMETHIA-27
Copy link
Contributor

PROMETHIA-27 commented Apr 18, 2023

I agree with alice; I think we should do what is necessary to ensure DLSS is as easy as possible to integrate, but it should be strictly up to a third party to do so.

@IceSentry
Copy link
Contributor

ensure DLSS is not as easy as possible to integrate

Do you mean as easy as possible? I don't see why we should make it not as easy as possible.

@PROMETHIA-27
Copy link
Contributor

Yep, typo

@JMS55 JMS55 moved this to Revisit in @JMS55 Bevy Plans Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

No branches or pull requests

5 participants