Search Unity

Target DPI vs Render Scale vs Resolution Scaling Fixed DPI Factor vs SetResolution

Discussion in 'Editor & General Support' started by Serge144, Mar 17, 2021.

  1. Serge144

    Serge144

    Joined:
    Oct 2, 2018
    Posts:
    65
    Ok, so I'm trying to boost performance and battery life of my mobile game.

    But from my research I see that there are four different 'knobs' that improve performance and battery life.

    The 'knobs' are the following:

    1) The SetResolution method
    2) Target DPI (Project Settings -> Player -> [Choose Android Platform] -> Resolution Scaling Mode -> Fixed DPI)
    3) Render Scale (Project Settings -> Graphics -> [the asset you inserted in Scriptable Render Pipeline Settings]
    4) Resolution Scaling Fixed DPI Factor (Project Settings -> Quality -> Rendering section)

    I'm not sure whats the best approach to this. There's so many 'Knobs' that I dont know which should I be using to make a "battery life saver mode" in my game that the user may choose to set.

    Any advices?

    Thanks in advance.
     
    andreiagmu, oAzuehT, sonnyb and 2 others like this.
  2. p0w1nd

    p0w1nd

    Joined:
    Oct 28, 2015
    Posts:
    140
    I'm curious about this too. Anyone has experience to share?
     
    5minlab_dev likes this.
  3. renegadegd

    renegadegd

    Joined:
    Mar 23, 2014
    Posts:
    10
    I also want to throw my hat in the ring to get some info on this.

    From what I understand the Render Scale for Scriptable Render Pipeline Settings will only affect your cameras, meaning your UI will stay crisp.

    Target DPI / Resolution Scaling Fixed DPI Factor seem to affect the entire final image however I can't work out the difference between these two. According to the documentation, the maths here is...

    Code (CSharp):
    1. min(Target DPI * Factor / Screen DPI, 1)

    ...so not sure why you would choose to lower one over the other.

    Currently, I'm finding on my android device (Samsung S20, native 2322 x 1080, 120hz, 480dpi) the best option for pure performance is Target DPI / Resolution Scaling Fixed DPI Factor (I dropped my dpi to 240, it was 'acceptable' but you lose UI quality, looks a bit muddy). Render Scale gave me some frames back but not as much, however, the UI remained crisp.

    This makes sense since using the DPI settings is probably asking less to be rendered by the device. Render Scale is rendering the camera image at a lower resolution but ultimately the game is probably still asking the device to render the final image at the native resolution.

    Hopefully someone can give a clearer breakdown, this is just me having a play around for a few hours so don't take it as gospel. Hopefully I'm not spreading miss information!

    Would also recommend Graphy on the asset store for monitoring framerate on device, it also gives you device information and the resolution being rendered out.
     
    Last edited: Aug 9, 2021
  4. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Resolution Scaling Fixed DPI Factor is a percentage of the Target DPI value.

    For example, i have my Target DPI set to 400 and allow my players to use the full 400 or lower by setting the Resolution Scaling Fixed DPI Factor to lower than 1.

    1 = 400
    0.5 = 200
    etc
     
    Brother_77 likes this.
  5. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    233
    Last edited: Aug 23, 2022
  6. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    233
    Hi, Can someone give their thoughts of using the setting of Fixed DPI approach vs changing screen resolution.

    Both kind of achieve the same result, but is there any gain from one over the other ?

    Screen resolution:

    Code (CSharp):
    1. public int x, y;
    2. public Camera camera;
    3.  
    4. private void Start()
    5. {
    6.      Screen.SetResolution (x,y,true);
    7.      camera.aspect = 16f / 9f;
    8. }
     
  7. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    539
    I'm looking for the same answer, is there any difference between changing the dpi and the screen resolution?
     
  8. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    233
    Fixed dpi worked for me
     
  9. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Resolution Scaling Fixed DPI Factor does not seem to have any effect on a build for Quest 2.
     
  10. DirtyFred

    DirtyFred

    Joined:
    May 17, 2014
    Posts:
    29
    I am having the same issue. Did you find a solution?