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 3 of 3

Thread: gl aint telling me the truth about texture internal format

  1. #1
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    gl aint telling me the truth about texture internal format

    what i do is create a texture with a specific internal format eg GL_RGB4 .
    and then i query the internal format like so
    GLint format;
    glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTUR E_INTERNAL_FORMAT,&format);
    i get back the right answer GL_RGB4

    now if i load + draw someit with
    GL_RGB4 and GL_RGBA4 they should look the same on the screen right? ie they both use the same number of bits 4 for the rgb data.
    but they look different. GL_RGB5_A1 though looks the same as GL_RGB4. i notice the spec saiz that gl is only required to choose an approxiament internal representation of what u ask for but surely when i use this glGetTexLevelParameteriv it'll return the true internal representation + not the one that i asked for

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: gl aint telling me the truth about texture internal format

    You're actually querying what you requested the internal format to be, not something that corresponds to the true HW internal format.

    To get information about bit depths, you should be querying one of GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE, GL_TEXTURE_LUMINANCE_SIZE, or GL_TEXTURE_INTENSITY_SIZE.

    In our case, GL_RGB4 and GL_RGB5 both correspond to a 565 format, while GL_RGBA4 is 4444 and GL_RGB5_A1 is 1555.

    - Matt

  3. #3
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: gl aint telling me the truth about texture internal format

    cheers matt.
    hehe G3_R3_B2 gives me better quality than GRBA4 (prolly r5g6b5) looks like im gonna have to write a program to enumerate all the formats seeing what i ask for and what i get given

Posting Permissions

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