Take the 2-minute tour ×

I have a feeling this is one of those situations that will depend on the driver implementation since this scenario is not described in the OpenGL specification. However, I'm hoping that someone will know if using GL_(LINEAR/NEAREST)_ MIPMAP_* without generating MIP maps would be treated the same as using GL_(LINEAR/NEAREST)?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Define "without any active MIP textures"? I'm not sure how you would, since there's no such thing as a "mip texture" (a texture contains mipmaps, but mipmaps are not textures).

If you mean that you did not create a full mipmap pyramid, then it depends on how you set up your GL_TEXTURE_BASE/MAX_LEVELs. If you properly used these to tell OpenGL you only had one mipmap level, then you'll be fine. If you used glTexStorage to create your texture's storage, and you only told it to create one mipmap, again you'll be fine.

But if none of those apply, then OpenGL defaults to the least useful thing (per its usual idiocy): it sets the GL_TEXTURE_MAX_LEVEL level to 1000. Which means it's going to expect you to have defined mipmaps.

According to (desktop) OpenGL, a texture with mipmap filtering where the BASE/MAX_LEVELs refer to mipmaps that are not defined is not "texture complete". OpenGL defines that the value you get for a texture access against a non-complete texture is (0, 0, 0, 1).

In short, set your BASE/MAX_LEVEL properly and you won't have to worry. ALWAYS DO THIS.

share|improve this answer
Sorry for the bad terminology. Basically, what I meant was, if you use GL_LINEAR_MIPMAP_* without a call to glGenerateMipMap, will OpenGL treat it like GL_LINEAR. I think I got it. Thanks! –  user8709 Oct 7 '12 at 19:46
@user8709: "I think I got it." No, you did not. You do not have to call glGenerateMipmap. You can manually upload mipmaps if you want. The point is to set your BASE/MAX_LEVEL correctly always. Every time you create a texture and bind it, immediately make two glTexParameter calls to set the BASE/MAX_LEVEL to what you intend for them to be. –  Nicol Bolas Oct 7 '12 at 19:53
Yeah I got it. FYI, OpenGL ES 2.0 requires a full MIP map pyramid if you use MIP mapping. It does not support the GL_TEXTURE_BASE_LEVEL parameter. Support was added in ES 3.0. –  user8709 Oct 7 '12 at 19:58
Same goes for the MAX_LEVEL. –  user8709 Oct 7 '12 at 20:04
add comment

In my experience, all the non-generated mipmap levels will default to black.

So if you have a texture displayed at 1:1 resolution, and progressively zoom out, it will fade to black as soon as the 1rst mipmap is used.

I think this is the behaviour at least on NVIDIA and AMD; I never tried on powervr (since you're mentioning opengl-es).

share|improve this answer
add comment

Your Answer


