Skip to main content
GameDev.net gamedev.net
🔒 Locked

glGetTexImage with GL_LUMINANCE?

Started by Puppet Nov 11, 2006 at 11:56 AM 2 replies 1.9k views
Original Post
Puppet
Puppet
Would glGetTexImage with GL_LUMINANCE give me a grayscale texture where the pixel result is the sum of the components or the mean of the components? I.e. is it (R+G+B) or (R+G+B)/3? On my machine (nvidia 7600Go) it seems to be the mean, like a grayscale conversion. At the same time, I'm getting otherwise unexplainable reports from other machines that I don't have on-site debug access to (intel integrated gfx), that the textures are read back overbrightened. Could this possibly be attributed to different cards giving different results with GL_LUMINANCE?
Brother Bob
Brother Bob
The specification says L = R+G+B. If you want channel weighting, you can set the scale factors for R, G and B as you like with glPixelTransfer and GL_RED/GREEN/BLUE_SCALE. Scaling occurs before the sum.
Puppet
Puppet
Thanks, strangely enough, it doesn't seem to be the sum on my card, but the mean. Perhaps, the default scales are set differently between cards. Anyways, as it was in grayscale, I decided to just pick up the R channel instead.
Brother Bob
Brother Bob
All default values are well specified, and the scale values are 1 by default. Anything else is a broken driver.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.