• Advertisement

Archived

This topic is now archived and is closed to further replies.

16 bit color textures

This topic is 5923 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m having trouble loading some 16 bit color tgas into OpenGL. I think Photoshop saves them as 565 (I''m not sure though), and the textures load, but the colors are, off (looks like red is becoming green or something.) I''ve tryed both GL_UNSIGNED_SHORT_5_6_5_EXT and GL_UNSIGNED_SHORT_5_6_5_REV_EXT (bits flipped) as the pixel packing. Also, when I try to use GL_BGR_EXT as the format the texture doesn''t show up. Any ideas? (I''m pretty sure my data is right, I''m loading two bytes per pixel, straight from the tga file.)

Share this post


Link to post
Share on other sites
Advertisement
(beware i havent used this much)
thus youre reading width*height*2 data in

what internal format are u using GL_R5_G6_B5 as well as
GL_UNSIGNED_SHORT_5_6_5_EXT

>>red is green<<
thus BGR doesnt work, u could do the swapping yourself + see if that works eg r = (data>>5)&31 etc (code might be wrong try << i forget which way bitshifting works)


http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
GL_UNSIGNED_SHORT_5_6_5_REV_EXT is supposed to flip the colors for you. Do you know what the hex number for the GL_R5_G6_B5 internal format is (or is it not an extension?)

Share this post


Link to post
Share on other sites

  • Advertisement