Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to increase VR device resolution (antialiasing) eyeTextureResolutionScale

Discussion in 'XR Interaction Toolkit and Input' started by AlanMattano, Jan 18, 2021.

  1. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    I'm having antialiasing problems
    I set up x8 but is not enough
    I wish to upscale the VR rendering image at cost of performance.

    Using Unity 2019LTS and Samsung Odyssey

    using API eyeTextureResolutionScale is the way to go?
    This is not changing the resolution.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.XR;
    3.  
    4. public class XR_Settings : MonoBehaviour
    5. {
    6.     public float upscaleFactor = 4f;
    7.     public float downscaleFactor = 0.1f;
    8.     public bool enableUpscale = false;
    9.     public bool downscale = false;
    10.  
    11.     void Start()
    12.     {
    13.         float actual = XRSettings.eyeTextureResolutionScale;
    14.         Debug.Log(actual + "\n");
    15.      
    16.     }
    17.  
    18.  
    19.     void Update()
    20.     {
    21.         if (enableUpscale)
    22.         {
    23.             XRSettings.eyeTextureResolutionScale = upscaleFactor;
    24.             enableUpscale = false;
    25.             Debug.Log(XRSettings.eyeTextureResolutionScale + "\n");
    26.         }
    27.  
    28.         if(downscale)
    29.         {
    30.             XRSettings.eyeTextureResolutionScale = downscaleFactor;
    31.             downscale = false;
    32.             Debug.Log(XRSettings.eyeTextureResolutionScale + "\n");
    33.         }
    34.     }
    35. }