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 Any way to keep the quality of an object no matter the graphic settings?

Discussion in 'General Graphics' started by unity_Lv2C-2kho2CJ2A, Jul 23, 2021.

  1. unity_Lv2C-2kho2CJ2A

    unity_Lv2C-2kho2CJ2A

    Joined:
    Feb 14, 2020
    Posts:
    3
    I am currently making a game where there are a lot of paintings on walls and you have to get clues from the paintings, the problem is while lowering the graphic resolution the paintings are really blurry and low quality making them pretty much useless for the point of the game.

    Is there any way to always keep max quality for the paintings no matter if a user picks low graphics?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    There's no easy way, no. One of the features I most miss from Unreal was the ability to catoregize texture assets and control the texture quality settings per category rather than uniformly.

    The usual "solution" is to disable mip maps, which can cause performance and visual problems. But realistically it is the only solution to prevent textures from being affected by the texture quality settings.

    The other option is to disable the texture quality options and not let users set it at all.


    A more complex option would be to not keep those textures as assets, but instead load them at runtime. Keep them as png files in the resource folder and use
    Resources.Load("fileName.png")
    , though this comes with obvious performance complications as well as loading png files at runtime can be expensive.
     
  3. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    243
    Correct me if im wrong, but this wont help either (at least it didnt do anything in my tests). The runtime QualitySettings.masterTextureLimit is applied to all textures with mipmaps, be it regular textures, dynamically loaded textures or dynamically procedurally created textures.

    The only solution i found is to create a copy of original texture with increased resolution by the factor of 2^QualitySettings.masterTextureLimit, then copy original mipmaps into their corresponding mipmaps in new texture, essentially creating first N = QualitySettings.masterTextureLimit empty dummy mip levels.

    But its a terrible solution cause those empty mip levels still take up RAM as if they arent empty, and memory consumption grows rather quick with higher resolution textures and low resolution quality settings. If you have a 4k texture and user sets the quality to quarter resolution, well then you end up with original 4k texture with all its mips in memory, plus an 8k empty texture as a level-1 mip, and a 16k empty texture as a level-0 mip. And there doesnt seem to be any way to unload specific mip levels from memory afaik.
     
    Last edited: Aug 31, 2021
    bgolus likes this.
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,238
    Yowch. I'm guessing every time I've needed to generate textures at runtime I've ended up using render textures or used textures without mipmaps. I've never shipped a game that needed to load textures at runtime from disk / web, though I thought I tried it before where it loaded the full resolution texture in c#, but I might just not have noticed the GPU wasn't getting the full res mip. Doh!
     
    customphase likes this.