Search Unity

URP XRGraphics.eyeTextureResolutionScale is read only

Discussion in 'Universal Render Pipeline' started by Alverik, Mar 25, 2020.

  1. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Hi, just upgraded to URP 7.3.1 in Unity 2019.3.6f1 and started getting an error that XRGraphics.eyeTextureResolutionScale is read only (in UniversalRenderPipeline.cs line 138).

    So I changed:
    XRGraphics.eyeTextureResolutionScale
    To:
    XRSettings.eyeTextureResolutionScale = asset.renderScale;

    That seems to fix the issue, but just wanted to know if anyone from Unity can confirm this is the correct fix (I am using XR Management, will test a scene, but it's very late here, so will do it tomorrow.).

    Anyway, thanks in advance.

    Edit: I also noticed something annoying. Every time I restart unity it undoes my changes so I have to change the code again... Hope they post an official bug fix quick.
     
    Last edited: Mar 25, 2020
  2. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    I'm also interested by the correct way to use render scale in VR.
     
  3. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    85
    Alverik likes this.
  4. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    Yes, I upgraded URP to 7.3.1 and started getting the error. I thought maybe it wasn't compatible with my unity version, I was using a 2019.3.5f something version, so I updated to the latest my Unity hub showed 6f1, but the error persisted, which is why I decided to inspect the script myself.

    Full error:
    Library\PackageCache\com.unity.render-pipelines.universal@7.3.1\Runtime\UniversalRenderPipeline.cs(138,13): error CS0200: Property or indexer 'XRGraphics.eyeTextureResolutionScale' cannot be assigned to -- it is read only
     
  5. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    85
    Thanks, I send this to QA to verify. And we will have this fixed once it is verified. If you want to submit a bug, that could help a lot accelerating the process.
    Again, thank you for letting us know. Very much appreciated!
     
  6. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    I already upgraded the project to 2020.1 beta and URP 8.01, but I will try to setup a repro project in 2019.3 later if I can. I'm not sure, but I get the feeling the error only started showing after I installed some other packages.
     
  7. WonkeeKim

    WonkeeKim

    Joined:
    Apr 8, 2013
    Posts:
    19
    It seems URP's RenderScale overrides XRGraphics.eyeTextureResolutionScale. When I change XRGraphics.eyeTextureResolutionScale in low resolution on Quest, it lowers the resolution but it instantly backs to the default.
    Can any of Unity engineers confirm it? @ThomasZeng