Jump to content
  • Advertisement
Sign in to follow this  

16bit monochrome textures

This topic is 4554 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 trying to load a 16bit monochrome texture using the pbuffer, and than read it back to memory. I tried several configurations, but none worked good. I'm using resident textures initialized with this command:
when loading the texture, I'm using:
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_LUMINANCE, GL_UNSIGNED_SHORT, imgBuffer);
when I'm reading the pixels back to the memory, I see that all the components are the same (r,g,b) but wrong. I'm using:
glReadPixels(0, 0, x, y, GL_GREEN, GL_UNSIGNED_SHORT, imgBuffer);
. I tried several internal formats, such as GL_LUMINANCE, GL_LUMINANCE16(gave only '0'), GL_LUMINANCE16_ALPHA16 etc. each gave different output. I also tried initializing the pbuffer with different configurations. using wglChoosePixelFormatARB, I can't get a configuration with 16bit color components when I'm using these attributes: WGL_DRAW_TO_BUFFER_ARB,true WGL_COLOR_BITS_ARB,64 WGL_GREEN_BITS_ARB,16 WGL_RED_BITS_ARB,16 WGL_BLUE_BITS_ARB,16 WGL_ALPHA_BITS_ARB,16 WGL_DEPTH_BITS_ARB,24 WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB when using wglChossePixelFormatARB with attributes, I can only get formats with 8bits per component, but when I'm calling the function without attributes, I can get the above configuration. I tried to force this configuration, but I still got wrong values. for example, if my texture was 0xFF or 0xF0, I got back in the imgBuffer 257. if it was 0xF I got "0". I'm using Geforce 6200

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!