GL_COLOR_MATRIX, how it works ?

I’d like to use a color matrix to make select object looks red in my program.

Program is: the color matrix seams discarded… Can I have that effect by this way ? And how ? Neither colored objects nor texture objects render change when I use the matrices. Is there anything to enable ?

Colored objects have just one color for the whole object so that I just compute myself the new color but for textured object … It’s not a appropriate solution.

Thank!

Colored objects have just one color for the whole object so that I just compute myself the new color but for textured object … It’s not a appropriate solution.
Yes it is.
Use GL_MODULATE as texturing env mode :
glTexEnv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

See faq here :
http://www.opengl.org/resources/faq/technical/texture.htm#text0030

However, this is already how it is set, lighting works perfectly

So what ? You should be able redify your textured object with a simple glColor3f(1,A,A); and choose A value between 0 and 0.9 to your liking.

If it does not work or if i misunderstood something, please ask.

It’s supose to be but it is not… :frowning:

I might have enable(or not) something I should not, I don’t really understand. Lighting great, texture great too, primary color and color matrix dicarded.

I would prefer color matrix to gray scale some texture too.

In that type of case, shaders are so great… but that not an option yet…

Use glColorMaterial ?

Color matrix is part of imaging extensions right ? Rarely accelerated.

Part of OpenGL 2.1 specification and even 1.2.1 specification. I gest it’s not from GL_ARB_imaging. Even if it is, even if it isn’t hardware accelerated, this extension is supported by my card (GeForce 8800) so it should work somehow.

I have created a test program where I feature out that GL_COLOR_MATERIAL must be enable to get primary color included when an objet is rendered with lighting…

In previous tests I also get the color matrix working when I was using glDrawPixel stuff… Maybe it’s limited to this …

It’s from the imgaing subset from the core API. The imaging subset is not an extension, but an optional part of the core. Its presence is detected via the extension string, but it’s not an extension, it’s an optional part of the core.

And like the whole imaging subset, it only work on pixel transfers, not on rasterized primitives.