PDA

View Full Version : GL_LUMINANCE vs. GL_INTENSITY



Jan
08-25-2003, 10:45 AM
Hi guys.

I was wondering, what GL_INTENSITY means. I have seen it in some presentations as texture-formats, but i could not find any reference, which explains, what it is actually used for. If i understand it correct, than GL_LUMINANCE is a texture-format for grayscale images. But where is the difference when i use GL_INTENSITY?
I checked all my OpenGL books and looked at the Red Book, but GL_INTENSITY isnīt even listed as a texture format. http://www.opengl.org/discussion_boards/ubb/confused.gif

Well, my real problem is the following:
I want to do something with specular lighting, and i need a texture, which holds some data. Actually it is only one single value. So i thought of using a GL_LUMINANCE texture-format. But in my documentation there is only a GL_LUMINANCE16 mentioned, no GL_LUMINANCE32. I donīt know if i need it, but i think it might be usefull, since specular lighting is very dependent on high precision. So i thought of using GL_INTENSITY, but since i didnīt find any information about that, i am not sure if it will work the way i expect it to work.

Maybe someone can clear things up a bit for me.

Jan.

Bob
08-25-2003, 10:55 AM
Both INTENSITY and LUMINANCE are single channel images. If we call a single pixels value I and L respectively, then the RGBA value for each of the two types is:

LUMINANCE: R=G=B=I, A=1.0
INTENSITY: R=G=B=A=L

Luminance is a greyscale image with alpha set to 1. Intensity is a greyscale image with alpha set to the greyscale value.

JustHanging
08-25-2003, 11:02 AM
So you have a new specular solution? Care to share?

Also, if it's just a single value, maybe you could just use the texture enviroment constant instead of a texture. You can set it by glTexEnvfv.

-Ilkka

Jan
08-25-2003, 11:15 AM
First, thanks for the explanation. Itīs a shame that none of my documentations include an explanation, although it would be very easy.

Well, no, i donīt have a NEW specular solution. All i want to do is to try the way, which is explained in "The OpenGL Extensions Guide" by Eric Lengyel. The description of the algorithm is VERY short (1 page), so i still have to do most of the work (and cannot just copy it from the book).

And itīs not only a single value, i do need a big texture to do a texture-fetch in a texture-shader, but i only need one component, i donīt need a red, a green, a blue and an alpha component. Thatīs what i meant with "one single value".

I cannot really explain how the algorithm works. I first have to try it myself. But since i have not found any demo, that uses this approach, yet, i might do one, if i get it to work.

Thanks again,
Jan.

Bob
08-25-2003, 01:52 PM
Originally posted by Jan2000:
First, thanks for the explanation. Itīs a shame that none of my documentations include an explanation, although it would be very easy.

In that case you collection of documents lacks the most important one; the specification (http://www.opengl.org/developers/documentation/specs.html) . In the 1.4 spec, look up section 3.8.13.