juanl3l
06-16-2010, 05:31 AM
I've drawn a BMP image with glTexImage2D() and I need black pixels to be shown as red. How can I do it? Any ideas?
lobbel
06-17-2010, 04:46 PM
You can do that by a simple shader.
void main()
{
vec4 color = texture2D(myTexture, texCoord.xy);
if(color.rgb == vec3(0,0,0))
{
color.rgb = vec3(1,0,0);
}
gl_FragColor = color;
}
Or you can use oldstyle opengl colortable.
regards,
lobbel
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.