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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Strange error message: mipLevel < m_MipCount

Discussion in 'General Graphics' started by JoergLange, Nov 19, 2016.

  1. JoergLange

    JoergLange

    Joined:
    Oct 22, 2015
    Posts:
    21
    I load some textures at runtime, which works perfectly fine, including mipmaps:

    photoTexture = new Texture2D (2, 2, TextureFormat.DXT5, true);

    However this causes a strange "error message" in the editor (console):

    ! mipLevel < m_MipCount

    This error has no effect, I'm able to build the project, but it's a bad feeling, seeing this always at the console.

    Has anyone an idea how to get rid of those message?

    Best regards
    Jörg
     
  2. mikaelwallen

    mikaelwallen

    Joined:
    Jun 3, 2016
    Posts:
    56
    I also just ran into this when doing:
    m_texture = new Texture2D(
    1,
    1,
    TextureFormat.DXT1,
    true);

    m_loader.LoadImageIntoTexture(m_texture);

    As you can see the texture is just created to be able to fill in the data from a WWW object.
     
  3. JoergLange

    JoergLange

    Joined:
    Oct 22, 2015
    Posts:
    21
    If you use a different texture format (RGB24 I believe) it works fine, without the error msg.

    But I have to use DXT5 and even if the problem is some kind of a non-event (because the program still runs fine), the red error msg are a bit annoying, feels not good.

    So it seems there is no workaround for that?
     
  4. JoergLange

    JoergLange

    Joined:
    Oct 22, 2015
    Posts:
    21
    Since I upgraded to 5.5 yesterday the "error" has changed to:

    Assertion failed on expression: 'mipLevel < m_MipCount'

    However, its the same strange thing. Everything runs fine, but this bloody messages in the editor during runtime driving me nuts... grrrr
     
  5. the-small-Hippopotamus-amphibius

    the-small-Hippopotamus-amphibius

    Joined:
    Nov 26, 2019
    Posts:
    1
    new Texture2D(int width,int height,TextureFormat textureFormat,bool mipChain,bool linear)
    Make sure the legth and width are not zero.
     
  6. cholleme

    cholleme

    Unity Technologies

    Joined:
    Apr 23, 2019
    Posts:
    25
    This is caused by the fact that DXT5 textures should at least be one DXT block in size (4x4 pixels) so creating a 2x2 or 1x1 DXT texture is invalid. We noticed this issue previously and it should be fixed (by giving a clearer error) in 2021.
     
    Siccity and unity_O7EbXnl7l5GFDg like this.