View Full Version : GL_COLOR_MATRIX, how it works ?
09-20-2007, 08:58 AM
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.
09-20-2007, 09:40 AM
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 :
09-20-2007, 10:13 AM
However, this is already how it is set, lighting works perfectly
09-20-2007, 01:15 PM
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.
09-20-2007, 04:11 PM
It's supose to be but it is not... :(
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...
09-20-2007, 05:49 PM
Use glColorMaterial ?
Color matrix is part of imaging extensions right ? Rarely accelerated.
09-21-2007, 03:45 AM
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.
09-21-2007, 04:08 AM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.