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 Mip Stripping use case?

Discussion in 'Editor & General Support' started by AcidArrow, Dec 24, 2020.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    Can someone help me understand why Mip Stripping was introduced in recent Unity versions?

    I am talking about this : https://docs.unity3d.com/2020.2/Documentation/ScriptReference/PlayerSettings-mipStripping.html

    Which says "When enabled, strips unused mipmaps at build time."

    Fair enough. Sounds good, but what is an unused mip? An actual unused mip is a mip that never shows in my game, because the camera never goes far enough from it, which isn't something that Unity can know at build time. So what are the criteria?

    Huh?

    Quality Settings...

    Does anyone even use that any more?

    So in my case, where I only have one Quality level with Full Res, enabling mip stripping, would effectively kill mips for all textures?

    And that's good because...???

    What's the use case here?
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,444
    I don't think that's what the documentation tries to convey. I believe it works like this...

    Lets assume the texture in question is 1024x1024.

    If you set "Texture Quality = Full Res", Mip Stripping will not remove anything and that texture stays at 1024x1024.

    If you set "Texture Quality = Half Res", Mip Stripping will get rid of mip 0 only. That is the 1024 mip, so the 1024x1024 texture becomes 512x512 instead.

    If you set "Texture Quality = Quarter Res", Mip Stripping will get rid of mip 0 (1024) and mip 1 (512). So the 1024x1024 texture becomes 256x256 instead.

    If you set "Texture Quality = Eights Res", Mip Stripping will get rid of mip 0 (1024), mip 1 (512) and mip2 (256). So the 1024x1024 texture becomes 128x128 instead.

    Reduce download size and required space on disk.
     
    AcidArrow likes this.
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    Really? I am not getting that at ALL from the documentation. Not saying you're wrong, but if that's what it does, docs are not clear at all.
     
  4. vickycl

    vickycl

    Unity Technologies

    Joined:
    Aug 23, 2018
    Posts:
    9
    Hi @AcidArrow, thanks for your feedback. And thank you @Peter77 for the brilliant explanation.

    Texture MipMap Stripping uses the Texture Quality level on the active Quality Levels for your target platforms to remove Mips from the builds. For projects where you may want full resolution textures on one platform but lower resolution textures on another, this setting ensures that the lower resolution platform does not have those mips that will never be used in the build. As Peter says, this should reduce the download size and disk space for that lower resolution platform.

    This can be used alongside Mip Map Streaming or Virtual Texturing, which reduces the memory usage by dynamically loading Mip levels.

    We'll make sure to make this documentation clearer. Hope this information helps!
     
    Bezoro, AcidArrow and Peter77 like this.
  5. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,739
    Isn't that the same as just going into the texture and setting a different resolution size for each platform?
     
  6. vickycl

    vickycl

    Unity Technologies

    Joined:
    Aug 23, 2018
    Posts:
    9
    Hey @creat327 sorry for missing your post!

    Yes, it should have the same effect as doing that, but without having to manually change all of the settings. Clamping the max size in the Texture Importer reduces the size before the mips are generated, whereas this setting will strip unused mips at build time.
     
  7. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    272
    Does it also work with Asset Bundles ?

    Edit : For anyone looking for an answer it's works with Scriptable Build Pipeline
     
    Last edited: Aug 2, 2023