Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Dynamically changing render scale on iOS in URP

Discussion in 'Scripting' started by BananaStem, Oct 25, 2019.

  1. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    41
    Hi all,

    I know that it's possible to detect the iOS device that the game is running on, but my question is, how would I adjust the render scale found in the UniversalRenderPipelineAsset.

    Would it be something along the lines as:

    bool deviceIsIphoneX = UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPhoneX;

    [HideInInspector]
    [SerializeField] float m_RenderScale = 1.0f;

    void Start()
    {
    if (deviceIsIphoneX)
    {
    m_RenderScale = 0.5f;
    }

    Any help would be appreciated, especially as I am fairly new to any type of programming.
     
  2. Harsh-NJ

    Harsh-NJ

    Joined:
    May 1, 2020
    Posts:
    315
    @BananaStem, have you found the solution, I also want to do similar thing on android. Please help if you have the solution.
     
  3. BananaStem

    BananaStem

    Joined:
    Sep 21, 2017
    Posts:
    41
    I found out that the feature is already part of Unity in the HDRP. Can't remember if it is in URP. Just called dynamic render scale.
     
  4. Harsh-NJ

    Harsh-NJ

    Joined:
    May 1, 2020
    Posts:
    315
    I need that in URP, as i'm developing on that, if possible.