Jump to content
  • Advertisement
Sign in to follow this  
svnstrk

black and white texture

This topic is 2852 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

hi,

if i want to save a black and white texture only that require only one byte value (256), instead of RGB(3 byte) or RGBA(4 byte), what should i put instead of RGB in this line?

glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB, textureWidth, textureHeight, textureDepth, 0, GL_RGB, GL_UNSIGNED_BYTE, texture3D);

thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
//GL_DEPTH_COMPONENT should work fine

When I read your post again I discovered that you are using glTexImage3D so it depends on what exactly you want to achieve

First thing check GL_EXT_shadow. If you success you can just use GL_DEPTH_COMPONENT. Use this if you want to store depth.

Otherwise try one of these depending on how you want to process stored texture

use single component like GL_RED/GL_GREEN/GL_BLUE/GL_ALPHA and than recalculate into same values for RGB components or use GL_LUMINANCE or GL_INTENSITY

[Edited by - SaTANO on August 28, 2010 4:12:26 AM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!