Search Unity

Resolved Render scale for HDRP

Discussion in 'SRP Dev Blitz Day 2022 - Q&A' started by PaulMDev, Sep 28, 2022.

  1. PaulMDev

    PaulMDev

    Joined:
    Feb 19, 2019
    Posts:
    72
    The render scale option on URP is very useful but I can't something similar in HDRP.
    Am I missing something or is this just not possible in the current version of HDRP ?
     
  2. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    265
    Hello,

    There is no exact equivalent to that, but you can use the "Forced Screen Percentage" option in the HDRP asset to lower the resolution of the main texture (it doesn't accept percentages above 100)
    upload_2022-9-29_11-29-15.png

    In scripts you can change the value like this:
    Code (CSharp):
    1. var dynamicResSettings = renderPipelineAsset.currentPlatformRenderPipelineSettings.dynamicResolutionSettings;
    2.  
    3. dynamicResSettings.forceResolution = true;
    4. dynamicResSettings.forcedPercentage = x;
    You can get the render pipeline asset either from the QualitySettings API or the GraphicsSettings depending on the use case.

    If you're looking to increase the render scale, I believe the easiest in HDRP would be to assign a bigger render texture in the output of the camera. You can also look into MSAA options since it can solve similar problems.
     
    _geo__, Onigiri and PaulMDev like this.
  3. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    Doesn't Work on me. I tried to cache it from Graphic Setting and with Serializefield but nothing works.
     
  4. _geo__

    _geo__

    Joined:
    Feb 26, 2014
    Posts:
    1,343
    @MTegarAsta : I tried this today and I too saw no effect at first.

    Then I thought RTFM. So there it was:
    "...To use dynamic resolution in your Project, you must enable dynamic resolution in your HDRP Asset and then enable it for each Camera you want to use it with....".

    Just wanted to leave this here for future me ('cause I will surely miss it again).
    DynamicResolution.gif
     
    tmonestudio likes this.
  5. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    still not working, I have done this before, because if I change it manually it will work, but not via script (in runtime the variable for forcePercentage still in 100).

    Hmmm actually I found another solution for this by using DynamicResolutionHandler from UnityEngine.Rendering
    upload_2022-11-11_11-27-32.png

    res Variable is for the scale percentage

    then turn off the force Resolution to off and set the minimum and maximum for the percentage scale (in my case between 50% and 100%)
    upload_2022-11-11_11-33-15.png
     

    Attached Files:

    _geo__ likes this.
  6. AlekseevEvgenii

    AlekseevEvgenii

    Joined:
    Nov 15, 2016
    Posts:
    1

    "the easiest in HDRP would be to assign a bigger render texture in the output of the camera" - Please tell me how to do this.