Using only selected mipmaps from the chain

Started by
2 comments, last by maxest 14 years, 7 months ago
I want to use only selected mipmaps. More specifically, I want to use only 2 first mips from the chain. So I thought about quite obvious solution - generating only 2 mipmaps. But *how* to do that? gluBuild2DMipmaps always generate a full chain, the same as GL_GENERATE_MIPMAP flag. So the only solution is to manually call glTexImage and manually rescaling every texture to fit mipmap size? Any better ideas?
Advertisement
Got it.
I use glTexImage2D + glTexParameteri(GL_GENERATE_MIPMAP -> true) and I used GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL to control levels of loaded mipmaps. Works nice
For future coding goodness you may want to consider glGenerateMipmap in place of the deprecated (and removed in 3.2) texture parameter...
If *they finally implement that function correctly, why not? ;)

*
NVidia, on GF8400 and GF6600 mipmaps are not regenerated when going to full-screen from minimized mode (I mean when OGL loses it's "device") and it has to be done manually. Quite annoying since anything else doesnt need to be recreated.
ATI - afair it simply doesn't work as it should. Maybe current drivers work well now.

This topic is closed to new replies.

Advertisement