Results 1 to 4 of 4

Thread: Texture Formats?

  1. #1
    Senior Member OpenGL Pro
    Join Date
    Dec 2007

    Texture Formats?

    Hi there!
    Basically I've got these formats stored in my image files (they are tga):
    alpha or luminance

    what I did so far was to convert them to RGB or RGBA as needed (all GL_UNSIGNED_BYTE). Now I read about BGR/BGRA format to be the fastest at least on nVidia hardware. Am I right that these formats are no part of the standard OpenGL 1.1 specification? They would help me as well, because I wouldn't have to reorder the tga data anymore.
    Is specifying the internal format of any use, or will the driver chose the best anyway? Will I have to check for the vendor to use the best formats???
    I'm a bit curious about which formats to use, especially because my OpenGL book gets outdated a bit (it's 1.0 with a special 1.1 chapter... but it's german) and it doesn't cover any extensions.

    I'd be pleaseful for any insight!

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010

    Re: Texture Formats?

    Michael, BGR became part of opengl 1.2 , yet i believe even the ms software 1.1 version can recoginze it (dont quote me on that), so its pretty supported. u can check with glGetExtensions
    using it is a piece of **** eg
    glTexImage2D(GL_TEXTURE_2D,0, GL_RGB, width, height,0, GL_BGR_EXT, GL_UNSIGNED_BYTE, (GLvoid *)(image));

    no need to get the extension pointers.

  3. #3

    Re: Texture Formats?

    Hehe I'm useing the opengl 1.1 and it doesn't conver extension either so it's not just the 1.0 book. Haven't look at the 1.2 book...

    You'll probable have to download the glext.h to use the extension.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Dec 2007

    Re: Texture Formats?

    Je... thanks guys! I decided to check wether EXT_bgra is supported and use BGR/BGRA/LUMINANCE as uploading format then, which saves me to swap the components, and which causes faster texture upload. So it's a win/win thing... .

Similar Threads

  1. Render to texture - texture formats and parameters?
    By Pilpel in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 01-24-2016, 10:09 AM
  2. Mac 3D Texture Formats
    By toneburst in forum OpenGL: macOS
    Replies: 0
    Last Post: 05-10-2008, 01:42 AM
  3. Texture Formats and FBO
    By Corrail in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 08-18-2005, 01:20 PM
  4. 36-bit,48-bit texture formats.
    By DimaS in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-01-2003, 11:23 AM
  5. texture formats
    By mdog1234 in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-17-2003, 05:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean