What is a Luminance Texture and How to Create?

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

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.

[QUOTE=blabz2007;1255927]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+?
[/QUOTE]
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.

What do you mean by “swizzle?” Repeat it for each value?

i’m from the future!

the glsl colur objects/structures can be accessed in “funny” ways to do odd things

instead of …

vec4 colour = ... something ...
vec3 red_red_red = vec3(colour.r, colour.r, colour.r);
vec3 green_blue_alpha = vec4(colour.g, colour.b, colour.a);

… you can “swizzle” to get these results like …

vec4 colour = ... something ...
vec3 red_red_red = colour.rrr;
vec3 green_blue_alpha = colour.gba;

… and I guess that makes life easier, or, seemed really cool to whomever was writing the GLSL language.

So … yeah - you’d swizzle it as .rrr or .rrrr