PDA

View Full Version : texture mipmap questions



remdul
08-13-2006, 08:46 AM
1) Is it possible to store mipmaps of a single texture in a different format? For example storing level 0 as GL_COMPRESSED_RGB, the 1st level as RGB4, and the 2nd as GL_LUMINANCE and a 3rd as BGRA? Does a mipmap have to be smaller than the previous level? Can each mipmap be considered independent of other mipmaps in this regard?

What are the restrictions and could this affect performance or texture compression efficiency?

2) I noticed that mipmaps generated with GL_SGIS_generate_mipmap are slightly different (darker and more greenish) from my own generated mipmaps. I take the average of each 2x2 pixels.
Could this be due to rounding errors in my code, or perhaps driver optimizations? I doubt it has anything to do with texture sharpening and other driver tweaks (all disabled). Any suggestions?

k_szczech
08-13-2006, 09:57 AM
1) You can't mix formats with different number of components.

2) It could be caused by internal texture format being R5G6B5 - green component will average differently than red and blue components.

remdul
08-13-2006, 04:50 PM
1) That makes sense, but I wasn't sure.

Is it safe assume that, with exception of the number of components and that all mipmaps need to be present, any combination would work on any implementation (provided the formats are supported)?

2) Interesting idea. I'll try querying the mipmap formats.

Bob
08-14-2006, 05:47 PM
Originally posted by remdul:
1) That makes sense, but I wasn't sure.

Is it safe assume that, with exception of the number of components and that all mipmaps need to be present, any combination would work on any implementation (provided the formats are supported)?
Not sure what combinations you refer to, but if you're still talking about pixel formats for textures, then the specification requires that all mipmap levels must have exactly the same pixel format.

And regarding size, which isn't addressed yet, the next lower mipmap levels must be half the size.

Mipmap levels aren't arbitrary textures. Once the base level is defined, the the size and format of all other mipmaps is well defined; they all have the same pixel format, and they all are half the size of the previous mipmap.