Search Unity

Bug [HDRP 12.1.3] Screen is cropped when DLSS is on in player

Discussion in 'High Definition Render Pipeline' started by alloystorm, Jan 17, 2022.

  1. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    It works fine in editor, but in player when DLSS is on the screen is cropped and the cropped size depends on the actual render size of current DLSS mode.

    I've submitted a bug report for this.

    Last known good version for me is still 2021.2.0b13, but it's far from perfect, just not totally broken like all the 2021.2 versions after it.

    Please Unity focus more on QA!
     
    Last edited: Jan 17, 2022
  2. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    For me in Player it's fine, in Builds I have exactly same issue. How do you use 2021.2.7? With HDRP 12.1.3? Does it work together? As in 2021.2.7 we had the severe RenderGraph issue, which was only solvable with local patch.
     
  3. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    No 2021.2.7 doesn't work with HDRP 12.1.3, I'll have to use 12.1.2 instead.

    By "player" I mean build, I think we have exactly the same issue. The other thing I noticed with DLSS in this 2021.2.8 version is that when you have DLSS on by default in camera settings, turning it off and on again dynamically in game actually slows down FPS quite a bit. I have to toggle off dynamic resolution in project to get the normal behaviour.
     
    Last edited: Jan 17, 2022
  4. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    ok, so you use the patched version of 12.1.2 again, right? Because this version contains the severe RenderGraph issue.
    DLSS seems to tank on FPS sometimes (I did not find a pattern when this happens), changing the quality level during runtime sometimes mitigates the issue. This behavior is afaik present in all HDRP versions with DLSS included.
     
    Yokogeri likes this.
  5. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    I'll have to take back what I said about 2021.2.7.

    Turns out there must be some compiled shader in the cache that made me think the ShaderGraph issue is not present in this version. When I save the graph the error comes back again. It is not usable as well. I'm not aware the RenderGraph issue that you mentioned. The issue I have with most 2021.2 versions is that when subgraph contains keywords, they generate an error and cannot be used in any shader graphs.

    2021.2.0b13 is the last version that works for me.

    Frustrated.
     
  6. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    The rendergraph issue is some error which in editor makes the scene view grey after some time (sometimes seconds, sometimes minutes), or produce a crash in a build, basically making everything with CoreRP 12.1.2 unusable without a patch.
    The whole 2021.2.x release is in a bad shape, at least as long as you use HDRP. This is really frustrating, Guess I'll never leave the relatively safe LTS path again anytime soon.
     
  7. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Custom post process breaks when DLSS is enabled, this is a bug in unity / hdrp...
     
  8. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    I bet they are gonna tell us that this is already fixed but we just need to wait another 2 months for the fix to be available in 2021.2.
    Let's see...
     
  9. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
  10. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    Hi, with your issue, I think it might be expected behaviour.

    When you have DLSS on (or any dynamic resolution in general) the screen size is no longer the render size. When sampling renderred texture you need to take that into account.

    I also have a custom post effect in my project, and I found that you can simply replace _ScreenSize with _PostProcessScreenSize in your shader to get the normal view.
     
    Matjio likes this.
  11. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    That is implemented, but still doesn't work. Even happens with Unity's example custom post process effect (which is used in the submitted bug report)
     
  12. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    796
    Nope it's not expected (I posted this issue). It that specific repro project it is possible to notice that the same simple grayscale shader will work with AfterPostProcess injection point but not with with AfterOpaqueAndSky injection point.
    With AfterOpaqueAndSky the rtHandleScale is incorrect.
     
    olavrv likes this.
  13. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    It is very depressing to see how long it takes to fix such a integral bug...

    @pierred_unity is there any way to get this fix speeded up other than filing a bug report?
     
  14. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Only several days have passed since report was filled. I waited for a half of year to get a critical API fix in the LTS version. Like this one: https://forum.unity.com/threads/asy...lidoperationexception-on-nativearray.1011955/

    I don't think any speedup is possible until QA will process the report. And even then it will be fixed for the latest TECH stream first, and backports will land after several more months of waiting.

    It the previous versions of Unity HDRP was not tied to the editor, so we got fixes much much faster. Sadly, this is not the case anymore.
     
    Last edited: Jan 23, 2022
    alloystorm likes this.
  15. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    That's exactly the point I wanted to raise too. How come HDRP is now coupled with Editor versions? And it is even coupled at sub version level! That is the oppsite of where I expect it to be. I'm sure every programmer understands that this is a very bad situation from architectural standpoint.
     
    iamarugin likes this.
  16. Matjio

    Matjio

    Unity Technologies

    Joined:
    Dec 1, 2014
    Posts:
    108
    Hi everyone,
    The RenderGraph bug has been fixed in the GitHub (https://github.com/Unity-Technologies/Graphics) more than a month ago and released in 21.2.8 (sorry this was so long, we had a few issues blocking us to get HDRP to public releases + holiday break slowdown).
    For the DLSS issue I will check tomorrow.
    Re. coupling HDRP versions with Unity versions, we did this because many bugs were generated for users who were mixing and matching versions of the Editor with versions of HDRP without noticing. We also had issues releasing asynchronously with the rest of the packages. All this for better quality, but recently we got pretty unlucky on a few regressions and bugs :( . In case you want more flexibility, you can use the GitHub version of HDRP. On our side, we are trying to address the issues as soon as possible as well as working internally to allow us to deliver fixes faster in public releases. Super sorry for the encountered issues.
     
  17. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Thanks for the infos and honest words!
    FYI it's not just DLSS broken, but the whole dynamic resolution system ("only" in builds), so also FSR and stuff. In my opinion a bug like this should lead to a much faster reaction time. It basically renders a key feature of the 2021.2 release unusable, and we are in this state since more then a week now, not counting the six weeks before with a completely broken Unity release.
     
    Yokogeri likes this.
  18. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    This is correct, any type of dynamic resolution approach destroys custom post process
     
    Yokogeri likes this.
  19. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    This might be an additional issue, but it also does not work at all, as mentioned above. It crops the screen in builds, whether you use custom post process or not, independent of DLSS or FSR or whatever.
     
    Last edited: Jan 24, 2022
  20. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    It doesn't crop my builds using DLSS
    It would be great if you can check this. I am having a problem with custom post process and DLSS - when switching between two cameras with different DLSS settings at runtime, it only works on the camera that is initially enabled...
     
  21. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    765
    Hey, I tried quickly on my side to switch between two cameras with different DLSS settings and it seems to work as expected on 2021.2. Maybe it has something to with your custom post process ?
    Could you share more info about that or even better if you were able to throw a simple repro project our way, it would help us a lot to investigate.

    Thanks !
     
    olavrv likes this.
  22. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Hey @chap-unity in any update no the main issue (that dynamic resolution does not work in builds)? Do we need like a few weeks again until this is resolved with another HDRP release? What would be the suggested solution in the meantime? downgrade to 2021.2.7 with the local patch?
     
  23. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Super! Did you try it in a build? It works fine in the editor, only happens in builds...
     
  24. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    765
    I managed to repro relatively easily on my side.
    What seems to happens is in build, the resolution is cropped to the current DLSS input resolution.
    I talked a bit with the devs and it's taking some time because some part of the code needs a proper rewrite instead of doing a quick hot fix. I'll post here when I have more precise information.

    I'm curently doing a bisection to have the last working version before the regression. I'll keep you posted when found.

    EDIT: it does seem that the regression started from 2021.2.8f1.
    This engine version is the only one to have HDRP 12.1.3, so anything below should work properly. I checked 2021.2.7f1 (HDRP 12.1.2) and it seemed fine in build.
    The last 2021.2 versions, (2021.2.9f1 & 2021.2.10f1 with HDRP 12.1.4) are still affected though.

    Yes, tried in a build (2021.2.8f1) with two cameras, one with maximum quality, one with full performance.
    And since there's the previous mentionned bug, you can easily spot that the parameters are indeed properly applied because it is cropping the render since the input resolution is lower in full performance mode than full quality.
     
    Last edited: Jan 26, 2022
  25. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Interesting. My second camera is a VR camera (other camera is not VR), perhaps the issue is related to this, and not just two cameras with different DLSS quality settings. I am unable to test this properly in 2021.2.8f1 since DLSS breaks VR (OpenXR) in this version...

    DLSS ultra performance preset also has a bug, according to the render debugger this preset performs no up scaling (in/out resolutions are both 100%).
     
    Last edited: Jan 26, 2022
  26. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    Hi, is the fix going to be on 2021.2 (HDRP 12.1.x) or is it going to be on 2022.1 (HDRP 13.1.x) first?

    From your message I'm reading there won't be a fix until 2021.2.11 sicne 21.2.9 and 21.2.10 are already in the pipeline and can't possibly get fix for this am I right?
     
  27. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    In case anyone is wondering...it doesn't happen on 2022.1. It only happens on 2021.2 I just ported my project today so I had the chance to test it.
     
    chap-unity likes this.
  28. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Ok, this sounds kind of bad. Does it mean we'll either need to downgrade, or wait another like 4-6 weeks minimum for a working release? Does a downgrade from 2021.2.8 to 2021.2.7 (including HDRP downgrade) have potential side effects? Never did a downgrade so far....
    Also, I personally have the feeling something is not optimal in the Unity release process. Why have that many releases of the Editor, if you cannot do changes between the releases? This defies the purpose of a continuous or near continuous release process somehow. I guess it is because of the way Core RP / HDRP releases being connected to Editor releases now, that the processes feel like "broken" from the users perspective, or?
     
  29. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    None of this makes sense...and these bugs they are triggered by something...I've fixed these weird bugs by deleting and rebuilding the library, saving the whole game as a prefab and import to a new project etc. Doesn't mean if you downgrade, it won't be there...usually these bugs are decades old...waiting to be triggered...just don't waste your energy until you actually face it.
     
  30. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    765
    First, the problem is only there for 2021.2.8f1 (9f1, 10f1) version.
    Below that, it's fine, and for 2022.1 it's working fine too.

    Once this is fixed, this will land in the next binary release (2021.2.11f1 or more) with a bumped hdrp version (12.1.5 or more)

    Since we don't officially support downgrade, we can't really advise for it.
    However, since the downgrade is only between 12.1.3 to 12.1.2, I believe this shouldn't really "break" anything big time (tried it with the HDRP template). Keep in mind you will lose the bugfixes in 12.1.3 in the process (changelog here).
     
    Qleenie likes this.
  31. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Hm, not sure what you mean. There is a severe regression in new Unity release, which means we cannot use it for the monthly update releases of our game. So the only way out is to a) wait another 4-6 weeks until Unity fixes the bug or b) downgrade in order for us to release something working. We decided for b).
     
  32. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Thanks! We were able to downgrade. For others facing the same situation: you need to change the package versions of HDRP, Core RP and Shadergraph in the manifest.json back to 12.1.2, Unity won't adjust the versions by itself.

    PS: Don't forget to make the local changes to CoreRP as discussed in other threads, as 12.1.2 has the nasty RenderGraph issue.
     
    chap-unity likes this.
  33. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Wish it was that simple, usually when I downgrade to avoid something, either something new pops up or it may look like it is gone, but after few days later you find out that the downgraded version also has the same issue. It is ultimately up to you but my advice was to move up instead of going down or try a few things which I mentioned above. But if you decided to move, usually, the newer versions (The very reason I use Alphas and Betas) get the fix first, or the old stuff is replaced, hence the risk is reduced at getting stuck if a project that has a fixed ship date and a Unity Editor that is supposed to be stable, not so stable...and u have to spend extra time to investigate, research and port to a different version. Then u are forced into a corner waiting for the Unity's bug fix team's effort...and they usually don't make it. Completely fixing a bug and making sure of it takes months at times...most times it just won't get fixed in the next update...

    Just my 2cents..
     
    Qleenie likes this.
  34. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    this in general can make sense. but in our case we already shipped with version 2021.2.7, so downgrading to this version has no risk. Besides this, I hope that in this case the fix will be faster then a few months, as this is a key feature of the 2021.2 cycle which is broken.
     
  35. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    Any version between 2021.2b10 and 2021.2.8 have a shader graph issue that all our shaders won't work.
    2021.2.7 also has a render graph issue that they mentioned above.
    So whether downgrading works for you really depends on whether your project trigger those other bugs.

    For me, I'm still stuck with 2021.2b10 (published October last year...)
     
  36. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    @chap-unity Is there a bug ticket for us to track on this one? Also saw in release notes of yesterdays 2021.2.9 release a mentioning of "Fixed CoC size computation when dynamic resolution is enabled" without a case number; I guess this is unrelated to the crop issue?
     
    olavrv likes this.
  37. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    765
    Good news everyone, the issue has been fixed.
    I can't provide a PR link because the problem came from the engine side, not on HDRP Package.
    Hopefully, if everything goes right, it will end up in the main line soon and the 2021.2.11f1 will get promoted to users.

    This is unrelated. Here the fix for the one you are talking about.
     
    Last edited: Jan 28, 2022
    TanselAltinel, Qleenie and olavrv like this.
  38. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    I'm in Unity 2021.2.11 and HDRP 12.1.4 but the issue still present.
    Any ETA for this, or any projected release soon?
     
  39. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Other thread says in 2021.2.12.
     
    chap-unity and TanselAltinel like this.
  40. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    190
    Thank you for informing me!

    2021.2.12 will also include a Color Correction bug I've had a few headaches with, so I'm looking forward to that!
     
  41. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    TanselAltinel likes this.
  42. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    so new update 2021.2.12 is available; although nothing in "Known issues" nor "Fixes" again... I don't dare testing.... @chap-unity any info whether the patch made it in ?
     
  43. IVANMARTINEZ94

    IVANMARTINEZ94

    Joined:
    Aug 2, 2017
    Posts:
    10
    I have updated my project, and after doing a build I can confirm that the error related to scaling when DLSS has activated has been resolved
     
    alloystorm, Qleenie and olavrv like this.
  44. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Now all I need is the custom pass fix, and I'm back in business :D
     
  45. alloystorm

    alloystorm

    Joined:
    Jul 25, 2019
    Posts:
    88
    Thanks for the info. Will test my project now.
     
  46. Yokogeri

    Yokogeri

    Joined:
    Oct 14, 2013
    Posts:
    21
    Fix seems to work for our project as well which is great, but I noticed that framerate tanks like crazy in the editor when one has the Scene AND Game view visible in the same layout, while DLSS is on
     
  47. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    It seems DLSS is still broken somehow, as the same thing also happens in builds. For me, only changing of quality level sometimes brings unity back to normal behavior. This was reported as bug by another user a while ago (see https://forum.unity.com/threads/dlss-increases-motion-blur-other-perf-costs-by-over-5x.1206709/).
    As this makes DLSS unusable, this is kind of a severe bug IMO.
     
    olavrv likes this.
  48. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Are you using any custom pass or custom postprocess in your project where this happen?
     
  49. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    Yes, using custom pass for the world space UI. Also seeing artifacts on the UI while Dynamic Resolution is activated inside the UI.
     
  50. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515