PDA

View Full Version : What is a Luminance Texture and How to Create?



blabz2007
11-03-2013, 01:21 PM
I read the Luminance textures were deprecated as of 3.0+,

What are Luminance texture and how do you create them in OpenGL 4.0+?

Any assistance appreciated!

Thanks!
BlaBZ

carsten neumann
11-04-2013, 12:41 AM
AFAIK they essentially are single channel textures. In a compatibility profile you create them the same way as ever, in a core profile you use GL_RED as a format parameter for the texture - to get a single channel.

GClements
11-04-2013, 08:51 PM
I read the Luminance textures were deprecated as of 3.0+,

What are Luminance texture and how do you create them in OpenGL 4.0+?

A luminance texture (one created with an internal format of GL_LUMINANCE) is monochrome. It only has a single channel which is used for all three R/G/B components, i.e. the pixels are always a shade of grey.

In the OpenGL 3 core profile, you would use a GL_RED texture instead, and swizzle it as necessary in the shader.

blabz2007
11-04-2013, 09:01 PM
What do you mean by "swizzle?" Repeat it for each value?