PDA

View Full Version : what GL_LUMINANCE does?



gunslinger
02-18-2004, 02:27 AM
hi,
working on some code i came across the commands:

glTexImage3D(GL_TEXTURE_3D,0,GL_LUMINANCE8,width,h eight,horizon,0,GL_LUMINANCE,GL_UNSIGNED_BYTE,data );

and

glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,0,GL_LUMINANCE8_ALPHA8,size,size,0,GL_LUMINANCE_ ALPHA,GL_UNSIGNED_BYTE,data);

just what is the GL_LUMINACE format? I tried to man it, but i couldn' understand the explanation... Can someone put it in plain english pls????

Thx the Gunslinger

Bob
02-18-2004, 02:36 AM
It's single channel format where the single channel is copied into R, G and B, and alpha is set to 1. Basically, a greyscale format.

gvm
02-18-2004, 02:41 AM
From MSDN:
GL_LUMINANCE: Each element is a single luminance value. It is converted to floating point, and then assembled into an RGBA element by replicating the luminance value three times for red, green, and blue, and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer).

[This message has been edited by gvm (edited 02-18-2004).]

gunslinger
02-18-2004, 02:45 AM
well it makes sense,
since I am passing a greyscal texture to compute the horizon mapping http://www.opengl.org/discussion_boards/ubb/smile.gif

thank you
the G.