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

Feedback Texture mipMapBias setting should be exposed

Discussion in 'General Graphics' started by TimHeijden, Sep 19, 2020.

  1. TimHeijden

    TimHeijden

    Joined:
    Mar 5, 2015
    Posts:
    34
    While working on a game for multiple different platforms, I was looking at which texture settings would give the best result for multiple different resolutions. One of the things I noticed is that my UI textures would show artifacts. This is because in some scenario's I would use the actual x512 size of the texture, where in other scenario's I wanted to use the same texture at a lower size. Obviously the lower size variant would have these artifacts. MipMaps would seem like the logical solution, as this is also what solves the issue for textures used in 3D scenarios.

    Upon turning on mipmaps however, I ran into another issue. On some devices, the UI would be scaled down (1080p vs 720p screens for instance) and the engine would choose a lower "mip" too quickly. This is exactly what the mipMapBias setting is for! Offsetting the bias to -0.5 instead of the default made it so the lower "mip" would be chosen later and the visual was much improved!

    I've attached a screenshot showing what I'm talking about.
    1. On the top, you can see the texture with mipmapping turned OFF.
    2. On the bottom left, you can see the texture with mipmapping turned ON, using default bias (-100)
    3. On the bottom right, you can see the texture with mipmapping turned ON, using custom bias (-0.5)

    mipmaps.png

    Here is a side-by-side of the different mipmapbiases
    mip-single 0.png mip-single 1.png

    To the point of this thread then, is that this setting should just actually be exposed! It seems a perfectly legitimate solution for a scenario like this, but also for many other scenarios. At the moment, it is already possible to change it in script. It is even possible to do it in the inspector, but only in "Debug Mode".

    Because of this, the workflow is terrible. If you work together, there is (basically) no way to know what to expect in what is configured for each texture. I could set it "correctly" for 10 portrait textures, and then when a different person on my team adds a new portrait, he wouldn't know that it should be configured. Adding an editor script is possible of course, but it would still be invisible to any developer unless you turn on debug mode, which is extremely error prone.

    The simple solution then, is to please just expose it to the texture settings.
     
    iagocco, blueivy, sqallpl and 3 others like this.
  2. JAMSCommercial

    JAMSCommercial

    Joined:
    Sep 1, 2023
    Posts:
    4
    You can enable developer mode to have those parameters exposed
    https://www.unity3dtips.com/unity-fix-blurry-textures-on-mipmap/