Results 1 to 3 of 3

Thread: 32 BPP textures

  1. #1
    Guest

    32 BPP textures

    Hello!

    There is a problem that I can't figure out. I have a properly loaded 32bpp bitmap and to create a mipmap texture that can take advantage of alpha component I should use a following line :

    gluBuild2DMipmaps(GL_TEXTURE_2D, 4, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bitmap);

    Right? OK, but when I draw the texture it appears to lose its color depth (something like 16bpp). Suprisingly, when I specify that I use 3 components the texture colors remain valid but ... of course blending does not work. Something like this :

    gluBuild2DMipmaps(GL_TEXTURE_2D, 3, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bitmap);

    What can be the problem ?? I'd be thankful for any help!

    Thanks

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

    Re: 32 BPP textures

    When you specify 4 as the internal format you may be getting RGBA4444 but with 3 for internal format may get more color precision with RGB565. Instead of specifying 4 as the internal format you could try to be more explicit about texture format precision with some of the other internal format tokens. Try specifying GL_RGBA8 as the internal format token and it should give you a full 32 bits of precision if that is supported by your card. It may reduce your pixel fill performance and will use more texture memory as a result, there are other tokens that may be sufficient for you but still use less texture memory and fill faster, for example GL_RGB5_A1, but that will depend on your specific requirements.

  3. #3
    Guest

    Re: 32 BPP textures

    Thanks!

    One more question if you don't mind ... How do you think - is it better to use GL_RGBA8 textures or to simply use texture & transparency mask? Which one is more efficient ?

Similar Threads

  1. Applying textures to a sphere. I know nothing about textures.
    By ElFlautas in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-28-2018, 03:47 AM
  2. model textures being redirected to font textures
    By Tcll5850 in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 09-07-2014, 10:43 PM
  3. FBO Attached Textures Reused as Shader Source Textures
    By Rennie Johnson in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-22-2012, 09:43 PM
  4. Lots of small textures or fewer large textures?
    By jlamanna in forum OpenGL: Advanced Coding
    Replies: 30
    Last Post: 01-12-2004, 03:53 AM
  5. are GL_COLOR_INDEX textures converted to RGBA-Textures?
    By TB-Rex in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 12-18-2000, 06:34 AM

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