black and white texture

Started by
1 comment, last by dpadam450 13 years, 7 months ago
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
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]
luminance or intensity. I use intensity

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement