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

Question Quality/TextureQuality - Full Res vs Eighth Res = same visual texture resolution?

Discussion in 'Scripting' started by _watcher_, Jul 26, 2021.

  1. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    259
    Hello,

    I use script on following page to dynamically (runtime) change quality level of an example URP piece:
    https://docs.unity3d.com/ScriptReference/QualitySettings.SetQualityLevel.html

    All my Textures are Sprite2Ds.
    I have 2 quality Levels: High and Low.
    Texture Quality on High is set to Full Res
    Texture Quality on Low is set to Eighth Res (12.5% resolution of the 'high' counterpart)
    When i switch between these on the fly, and even if i change them manually in Edit Mode and then run Play Mode - i see no change in texture resolution of my Sprite2Ds in Play Mode.

    What gives? How can i dynamically set the texture quality of the sprites (i want to use High quality for desktop, and Low quality for mobile)? I must be missing something basic, yes?
     
  2. sarahnorthway

    sarahnorthway

    Joined:
    Jul 16, 2015
    Posts:
    78
    Old but, did you have Generate Mip Maps enabled on your textures? I think the Texture Quality setting (same as QualitySettings.masterTextureLimit? I think?) just goes down 1-3 notches from whatever mipmap texture scale it would usually choose.

    If it's working, you should see the effect immediately when you change that dropdown in the editor during play mode.

    The documentation is thin, but I think Half Res texture quality also means it doesn't load the biggest texture into memory, so while enabling mip maps on all your sprites will increase memory usage by 33% at full res, it will reduce memory by 66% at half res.

    I'm musing on this myself today so I'd like to know how this solution worked out for you, if it did.
     
    _watcher_ likes this.
  3. _watcher_

    _watcher_

    Joined:
    Nov 7, 2014
    Posts:
    259
    Definitely did not have mipmaps enabled.
    Interesting idea, but my app is 2D, i dont think mipmaps would work at all here, camera distance from content is always constant. I wonder.. did the default render pipeline use mipmaps for changing quality level? Sounds very strange!

    I actually found the solution for URP - somewhere in the pipeline settings file (the scriptable object file), there is a property called something like quality [dont have the editor open at, but its easy to find], its a slider. When you move it to a value lower than 100%, the textures will downscale dynamically and also the amount of RAM used is reduced. Just the actual texture quality is pretty bad.