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: GL_RGB, GL_RGBA, GL_RGB8,..... what is what???

  1. #1
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    GL_RGB, GL_RGBA, GL_RGB8,..... what is what???

    Maybe you think, this is a beginner question, but i am not so sure, because i am totally confused.

    My OpenGL-header (version 1.3) declares these constants:

    GL_RGB
    GL_RGB4
    GL_RGB5
    GL_RGB8
    GL_RGB10
    GL_RGB12
    GL_RGB16

    GL_RGBA
    GL_RGBA2
    GL_RGBA4
    GL_RGBA8
    GL_RGBA12
    GL_RGBA16

    GL_RGB5_A1
    GL_RGB10_A2

    Ok, i know, that if i want 16 Bit textures, i use GL_RGB16 or GL_RGBA16. But what do i use for 32 Bit textures? If i use GL_RGBA4 it might mean "4 Bytes", but what does then GL_RGBA8 mean, maybe "8 Bits per component", but it could also mean "8 Bits for all 4 components". And what is GL_RGB? Is it 24 Bits? But GL_RGB8 could also be 24 Bits, but it could also be "8 Bit for all three".

    AAAAAAAAAAAHHHHHHHHHHHHHH! I could go on like this for hours!

    And i tell you something else: Every single constant is defined different! There is none, which is just another constant for the same number, NO THEY ARE ALL DIFFERENT!

    Help me please, before i totally go crazy!

    Thanks in advance,
    Jan.
    GLIM - Immediate Mode Emulation for GL3

  2. #2
    Intern Newbie
    Join Date
    Mar 2001
    Location
    New Zealand
    Posts
    39

    Re: GL_RGB, GL_RGBA, GL_RGB8,..... what is what???

    Here is what I got out of the msdn library, remember that there is probably some padding of bits that occur when the number of bits used isn't byte aligned

    Constant.....Base Format R Bits G Bits B Bits A Bits
    GL_R3_G3_B2..GL_RGB......3......3......2..........
    GL_RGB4......GL_RGB......4......4......4..........
    GL_RGB5......GL_RGB......5......5......5..........
    GL_RGB8......GL_RGB......8......8......8..........
    GL_RGB10.....GL_RGB......10.....10.....10.........
    GL_RGB12.....GL_RGB......12.....12.....12.........
    GL_RGB16.....GL_RGB......16.....16.....16.........
    GL_RGBA2.....GL_RGBA.....2......2......2.......... 2
    GL_RGBA4.....GL_RGBA.....4......4......4.......... 4
    GL_RGB5_A1...GL_RGBA.....5......5......5.......... 1
    GL_RGBA8.....GL_RGBA.....8......8......8.......... 8
    GL_RGB10_A2..GL_RGBA.....10.....10.....10......... 2
    GL_RGB12.....GL_RGBA.....12.....12.....12......... 12
    GL_RGBA16....GL_RGBA.....16.....16.....16......... 16

  3. #3
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,946

    Re: GL_RGB, GL_RGBA, GL_RGB8,..... what is what???

    Of course the constants are different, what do you expect? They mean different things. :-)

    This is the documentation you need from the OpenGL spec:
    http://www.opengl.org/developers/documen...100000000000000

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: GL_RGB, GL_RGBA, GL_RGB8,..... what is what???

    Thanks!

    That was what i needed.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

Posting Permissions

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