Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: how to replace the color?

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2006
    Posts
    9

    how to replace the color?

    i mean to change the special color of the texture.it's different from blend.for exmaple,
    i just want to change the color(0.5f,0.5f,0.1f,1.0f) of the texture to color (0.4f,0.4f,0.4f,1.0f),but not to operate with all the colors of the texture.of course i can do this change using color data directly in memories,but i want to know is there a method or a function in opengl that can process the change.

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: how to replace the color?

    its not really possible though i suppose u could go in glsl
    Code :
    if ( dot( color, vec3( 0.5,0.5,0.1 ) ) > 0.999 )
       color = vec3( 0.4,0.4,0.4 );
     
    ps - this should be allowed in the postings -> '( and )' its a PITA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •