Opengl: use a texture only to give alpha channel to a colored object
Posted
by Damian
on Stack Overflow
See other posts from Stack Overflow
or by Damian
Published on 2010-06-11T02:16:03Z
Indexed on
2010/06/11
2:23 UTC
Read the original article
Hit count: 288
I'm new at OpenGL and I can't find out how to do this:
I want to render a letter and be able to change it's color, so I have a texture with the letter on a transparent background. I managed to render it using this code:
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
But that renders the letter in black, as it's on the texture. How can I render it with the color setted with glColor4f
?
© Stack Overflow or respective owner