Search Unity

  1. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice
  4. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Help Wanted 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,369
    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. }
     
unityunity