PDA

View Full Version : how to replace the color?



wexuv
09-25-2006, 09:26 PM
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.

zed
09-26-2006, 03:14 PM
its not really possible though i suppose u could go in glsl

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