Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: texture mipmap questions

Hybrid View

  1. #1
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    335

    texture mipmap questions

    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?

  2. #2
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,119

    Re: texture mipmap questions

    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.

  3. #3
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    335

    Re: texture mipmap questions

    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.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: texture mipmap questions

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •