Strange error message: mipLevel < m_MipCount

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

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.

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?

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

new Texture2D(int width,int height,TextureFormat textureFormat,bool mipChain,bool linear)
Make sure the legth and width are not zero.

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.

2 Likes

Anyone else who’s still using 2020, this seems to happen when images aren’t power-of-two sized.