Results 1 to 9 of 9

Thread: GL_COLOR_MATRIX, how it works ?

  1. #1
    Super Moderator Frequent Contributor imported_Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    937

    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!
    [URL="http://www.g-truc.net"]G-Truc Creation[/URL] - [URL="http://glm.g-truc.net"]GLM[/URL] - [URL="http://samples.g-truc.net/"]OpenGL Samples Pack[/URL] - [URL="http://www.openglinsights.com"]OpenGL Insights[/URL]

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: GL_COLOR_MATRIX, how it works ?

    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/...e.htm#text0030

  3. #3
    Super Moderator Frequent Contributor imported_Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    937

    Re: GL_COLOR_MATRIX, how it works ?

    However, this is already how it is set, lighting works perfectly
    [URL="http://www.g-truc.net"]G-Truc Creation[/URL] - [URL="http://glm.g-truc.net"]GLM[/URL] - [URL="http://samples.g-truc.net/"]OpenGL Samples Pack[/URL] - [URL="http://www.openglinsights.com"]OpenGL Insights[/URL]

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: GL_COLOR_MATRIX, how it works ?

    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.

  5. #5
    Super Moderator Frequent Contributor imported_Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    937

    Re: GL_COLOR_MATRIX, how it works ?

    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...
    [URL="http://www.g-truc.net"]G-Truc Creation[/URL] - [URL="http://glm.g-truc.net"]GLM[/URL] - [URL="http://samples.g-truc.net/"]OpenGL Samples Pack[/URL] - [URL="http://www.openglinsights.com"]OpenGL Insights[/URL]

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: GL_COLOR_MATRIX, how it works ?

    Use glColorMaterial ?

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

  7. #7
    Super Moderator Frequent Contributor imported_Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    937

    Re: GL_COLOR_MATRIX, how it works ?

    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.
    [URL="http://www.g-truc.net"]G-Truc Creation[/URL] - [URL="http://glm.g-truc.net"]GLM[/URL] - [URL="http://samples.g-truc.net/"]OpenGL Samples Pack[/URL] - [URL="http://www.openglinsights.com"]OpenGL Insights[/URL]

  8. #8
    Super Moderator Frequent Contributor imported_Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    937

    Re: GL_COLOR_MATRIX, how it works ?

    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 ...
    [URL="http://www.g-truc.net"]G-Truc Creation[/URL] - [URL="http://glm.g-truc.net"]GLM[/URL] - [URL="http://samples.g-truc.net/"]OpenGL Samples Pack[/URL] - [URL="http://www.openglinsights.com"]OpenGL Insights[/URL]

  9. #9
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: GL_COLOR_MATRIX, how it works ?

    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.

Similar Threads

  1. GPU never works
    By luizdrumond in forum OpenCL
    Replies: 1
    Last Post: 11-26-2012, 06:08 AM
  2. PBO w/ 1K works, w/ 2K dies
    By Smitty in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-23-2007, 09:58 AM
  3. VERY OT: IT WORKS, ha ha ha ha ha.
    By dabeav in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 01-26-2003, 06:50 AM
  4. OT: Who works for whom?
    By Shag in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 07-18-2002, 05:34 PM
  5. GL_COLOR_MATRIX on what HW is ist supported, how to emulate
    By husakm in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-28-2002, 07:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean