Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

Official DLSS Beta - Show Off Your Results & Call For Feedback

Discussion in '2021.2 Beta' started by Matjio, Aug 31, 2021.

  1. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    88
    Hi everybody,

    Starting with Unity 2021.2.0b6, HDRP is shipping with native support for NVIDIA’s Deep Learning Super Sampling (DLSS) which has also been available in our Graphics Repository for some additional time now.

    From our 2021.2 beta release blog post:
    NVIDIA Deep Learning Super Sampling (DLSS) is a rendering technology available for HDRP that uses artificial intelligence to increase graphics performance and quality. It allows you to run real-time ray-traced worlds at high frame rates and resolutions. It also provides a substantial performance and quality boost for rasterized graphics and improves the performance of VR applications so they run at higher frame rates. This helps to alleviate disorientation, nausea, and other negative effects that can occur at lower frame rates.



    If you haven’t tried it out yet, you can find information on how to get started in our official documentation.

    We’d like to take this opportunity and ask you how your experiences with DLSS in Unity 2021.2 have been so far. Please use this thread to show off the results you were able to achieve in your projects, ask any related questions you might have and give us your feedback.


    FAQ:
    • Do you have plans to port DLSS back to previous versions?
      • No plans for now. DLSS comes on top of many changes and improvements to dynamic resolution brought in 2021.2 at various levels of our graphics stack.
    • Do you have plans to make DLSS available for URP or built-in render pipelines?
    • What are the platform requirements?
      • It requires 64 bits architecture, DX11, DX12 or Vulkan and an NVIDIA graphics card compatible with DLSS.
    • Does it require some neural network training phase with my content?
      • No training is required.

    Known issues:
    • With the NVIDIA package installed in a project, even if DLSS is not used, the library is not stripped from the executable. (1332465)
     
    fuzzy3d, NotaNaN, Ruchir and 4 others like this.
  2. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    897
    The HDRP Render Debug view doesn't work correctly when using DLSS

    I set forced resolution to 50% (quality didn't matter)

    All the debug views seems to be of limited to half of the screen instead of scaling up(zoom in, you can see less than half of screen shows the debug info):
    upload_2021-9-2_14-29-7.png

    In the scene view, the debug view worked for some time after going gray and showing this error:
    upload_2021-9-2_14-28-35.png

    upload_2021-9-2_14-26-14.png

    Disabling debug view didn't fix this issue either, I had to restart unity or enter play mode (Domain reloading and scene reloading was enabled) to fix this (game view also went black)
     
  3. MJQStudioWorks

    MJQStudioWorks

    Joined:
    Oct 12, 2012
    Posts:
    595
    As for me i tested it since the 2021.2.0b6.
    I use DLSS as an AA (Anti-Aliasing), the quality is great especially in 8k UHD.
    Here's the video link: https://www.youtube.com/watch?v=--kT0k2iEUc

    About using DLSS with RayTracing, In build it is great
    but in Editor (Scene and Game view are visible) , it is slow.
    I hope there is an option to choose to make it work in Game View only.
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,045
    Hi @Ruchir,

    We weren't able to reproduce the described behaviour based on your description here. Could you please submit a bug report for it with a reproduction project attached?
     
    Ruchir likes this.
  5. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    897
    My internet is a bit slow to submit the whole project in bug report so I've uploaded a video showing the error and how to recreate them:


    I have uploaded the package manifest file and package lock file.
     

    Attached Files:

    LeonhardP likes this.
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,156
    DLSS has stopped working for me. In 2021.2.0b4 I had it working pretty and fast.
    I have 2 GPU's in my system:
    1080Ti (Primary)
    2070 Super (Secondary)

    When DLSS was working, my 2070 was the primary GPU. I swopped them a while back so the 2070 is the secondary. Now I dont know if it hasn't worked since then, as its also been few weeks since I looked at the project.

    It was working few weeks back, but I'm now greeted with this:
    upload_2021-9-14_13-14-44.png

    Could the issue be simple because I swopped my GPU's around, or is there something else I should be looking at?
    (NVidia Studio Driver 471.11)

    DLSS is now not working for me in neither 2021.2.0b4 nor the latest 2021.2.0b11...
     
  7. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    88
  8. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,156
  9. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    88
    @MJQStudioWorks
    Is it slower when you use DLSS than without when both Scene and GameView are visible, or is it that rendering both Scene and GameView with raytracing which is too slow?
     
  10. MJQStudioWorks

    MJQStudioWorks

    Joined:
    Oct 12, 2012
    Posts:
    595
    Hi,
    "Rendering both Scene and GameView with raytracing which is too slow." plus DLSS turned on,
    but it seem the performance on the Unity 2021.2b11 is now better,
    both scene and game view are visible with raytracing and DLSS turned on.
    It is even better if the resolution of the Game View is low res.

    Video:


    This might be a request, is it possible to add an option to only render ray tracing and DLSS in game view only?


     
    Last edited: Sep 14, 2021
  11. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    536
    You can already do that. In your HDRP Default Frame Settings, just uncheck "Ray Tracing". Then in your Custom Frame Settings for your camera, override this setting to true for your game view camera.

    upload_2021-9-14_15-13-38.png

    As for DLSS, it is only applied in the Game View anyway.
     
    Matjio, MJQStudioWorks and Ruchir like this.
  12. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,156
    Its working again now
    I swopped my GPUs around again so my strongest GPU is now the primary and I installed the latest NVidia Studio Driver
     
    Matjio likes this.
  13. MJQStudioWorks

    MJQStudioWorks

    Joined:
    Oct 12, 2012
    Posts:
    595
    Hi,
    Ah now i see, it means disable it on the HDRP Global Settings (This is global) and only render it on a camera (Game View).

    DLSS only applied to Game View already?
    Because previous beta, it also applied to scene view.

    Thank you so much for the reply and info.

     
    Matjio likes this.
  14. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    88
    @Ruchir Our teams have reproduced the issue and logged internally a bug.
     
    Ruchir and LeonhardP like this.
  15. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    37
    We just enabled this but there seems to be a problem with the compositor because our main camera now appears cropped to a quarter of the screen in the bottom left corner. Have you had any issues like this?
     
  16. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,045
    Hi @TekHK, this is the same issue that @Matjio confirmed in the post above. The devs are looking into it.
     
    chap-unity likes this.
  17. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    37
    Great- we discovered that it is connected to the quality settings on the asset/camera - if we put it on Ultra Performance it is fine, but if we choose higher and higher qualities it progressively crops the main camera view smaller each time. Hope that helps!
     
    LeonhardP likes this.
  18. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    37
    So an update from us - we managed to get our application working fine using Ultra performance - but actually we found that there was quite a substantial drop in performance when DLSS was enabled. So we have turned it off again. It would be really interesting to know in what circumstances you have noticed DLSS actually being detrimental to performance.
     
  19. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    897
    One more thing I Happened to notice was that the dithering pattern also get bigger with dynamic resolution (which is to be expected I guess), but is there a way to mitigate this because it's really noticeable at some distances.

    Here's and example:
    DLSS off:
    upload_2021-9-22_11-9-34.png
    DLSS on:
    upload_2021-9-22_11-9-18.png
     
  20. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    37
    Is there any update on DLSS and the compositor? I just tried beta 14 and there was no improvement at the moment.
     
  21. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    536
    You are right on the fact that it's totally expected. Dithering takes into account pixel size so if the resolutions everything is computed at changes, the dithering size will also change with that. One solution would be to "adjust" the dithering size according to the current forced resolution percentage.

    However, Unity's dithering pattern is a bit too uniform and it doesn't work well with DLSS. I tried a bit experimenting with other dithering pattern (especially blue noise) and the result is a tiny bit better because of it's non uniformity.

    Do you happen to have a repro project so that we can have a look ? (Or report a bug)
    I tried a little bit on the last versions but couldn't repro anything problematic with the compositor.
     
  22. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    897
    Is there a way to do this inside shader graph? (also, what if the screen size isn't forced)
     
  23. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    536
    Yes, the default dither function is pretty simple, you can just create a subgraph with a custom node with the same inputs/ouputs and then modify the function from there to sample another pattern instead of the default 4x4 array.

    If the size isn't forced, you can still get the current scale using DynamicResolutionHandler class.
     
  24. TekHK

    TekHK

    Joined:
    Jul 30, 2014
    Posts:
    37
    So hard to do this - we are on a very large project - actually it seems the compositor is working now - but the performance drop is a real shame. It is actually considerably slower with DLSS that without on all modes.
     
  25. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,156
    I want to make sure I'm actually using DLSS correctly, as another user's question over on the FSR thread, prompted me to question the way I'm using it!

    So as far I understand, it upscales things. But that is as far as my understanding goes. I simply install DLSS by clicking the "Fix" button in my HDRP Asset, (and I dont touch the screen percentage setting at all)

    Then on my camera, I enable Dynamic Res, and set DLSS to Ultra performance

    My game view is set to 4K.

    So then, where does the "dynamic" part of all this come in then? If my game view is 4K, does DLSS upscale it to 8K for better sampling and then the game view uses that info to just display my stuff at 4K?

    .....or am I suppose to be doing something with the screen percentage settings etc?
     
  26. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,038
    See my reply here: https://forum.unity.com/threads/amd...iew-now-available.1141495/page-2#post-7567978

    everything I said there applies to DLSS, and all other upscale filters.
    'Dynamic" refers to scaling the screen% (goes from 10-100%) as required to achieve your FPS goal. The lower the screen % is, the bigger the performance gain on the GPU. Rather than setting it manually to a particular screen%.
    Min/Max exists to help you with that. Min being the least amount it's allowed to go to when trying to achieve the budget you set, max the opposite.
    If you want the 'dynamic' part of it though, you'll have to do the GPU timings yourself. It's not built-in.
    Otherwise, you tick forceScreen% and set a value.
     
  27. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,156
    Ah well in that case, all the fuss is pretty useless for me as we're using Unity to render offline and any screen percentage lower than 100% just lowers the image quality.

    That being said, DLSS is not totally useless for us, as with screen percentage on 100%, or not even using forced screen percentage, the AA that DLSS gives us is miles ahead of anything we get with TAA. So in that sense we're purely using DLSS for AA
     
    mahdi_jeddi likes this.
  28. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    76
    Update: issue fixed by recreating HDRPDefaultResources

    I'm getting this error every frame if I turn on DLSS when SSR is not also enabled.



    IndexOutOfRangeException: Index was outside the bounds of the array.
    UnityEngine.Rendering.BufferedRTHandleSystem.Swap () (at Library/PackageCache/com.unity.render-pipelines.core@12.0.0/Runtime/Textures/BufferedRTHandleSystem.cs:187)
    UnityEngine.Rendering.BufferedRTHandleSystem.SwapAndSetReferenceSize (System.Int32 width, System.Int32 height) (at Library/PackageCache/com.unity.render-pipelines.core@12.0.0/Runtime/Textures/BufferedRTHandleSystem.cs:132)
    UnityEngine.Rendering.HighDefinition.HDCamera.SetReferenceSize () (at Library/PackageCache/com.unity.render-pipelines.high-definition@12.0.0/Runtime/RenderPipeline/Camera/HDCamera.cs:953)
    UnityEngine.Rendering.HighDefinition.HDCamera.BeginRender (UnityEngine.Rendering.CommandBuffer cmd) (at Library/PackageCache/com.unity.render-pipelines.high-definition@12.0.0/Runtime/RenderPipeline/Camera/HDCamera.cs:976)
    UnityEngine.Rendering.HighDefinition.HDRenderPipeline.ExecuteRenderRequest (UnityEngine.Rendering.HighDefinition.HDRenderPipeline+RenderRequest renderRequest, UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.AOVRequestData aovRequest) (at Library/PackageCache/com.unity.render-pipelines.high-definition@12.0.0/Runtime/RenderPipeline/HDRenderPipeline.cs:1918)
    UnityEngine.Rendering.HighDefinition.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at Library/PackageCache/com.unity.render-pipelines.high-definition@12.0.0/Runtime/RenderPipeline/HDRenderPipeline.cs:1816)
    UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at <aa6b3287749940ddb5dc03218a47d0d4>:0)
    UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, System.Collections.Generic.List`1[T] renderRequests, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <aa6b3287749940ddb5dc03218a47d0d4>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
    Last edited: Nov 8, 2021
  29. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    76
    Update: issue fixed by recreating HDRPDefaultResources

    There is another error when raytracing is enabled:

    RTHandle was created using a regular Texture and is used as a RenderTexture
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
    Last edited: Nov 8, 2021
  30. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    897
    I found one more issue with AA when using DLSS:
    upload_2021-10-26_10-1-8.png
    You can see the jagged edges of the rectangle on the plane, the rectangles are procedurally created using shaderGraph:
    upload_2021-10-26_10-3-30.png

    Is there a way to fix this?
    These are my camera settings:
    upload_2021-10-26_10-4-27.png
    upload_2021-10-26_10-4-46.png
     
  31. StCost

    StCost

    Joined:
    Mar 1, 2017
    Posts:
    24
    Also having this issue
     
  32. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    76
    I managed to fix my issue by recreating the HDRPDefaultResources folder. The one in my project was created several versions back and maybe something is no longer compatible.

    Basically I removed that folder and used the HDRP wizzard to recreate it. Everything works fine now.
     
    LeonhardP likes this.