How to blend a quad, already with a texture on it
-
22-07-2019 - |
Question
I made a quad with a nice texture on it. The texture has an alpha channel (RGBA). I replaced the quad with the texture (GL_REPLACE)
, so now I have a billboard with (semi)transparant pixels on it.
So far, no problem.
But now I want to blend the entire billboard, so it's overall opacity changes.
How would I do this?
Solution
GL_MODULATE, instead of GL_REPLACE, after setting the color to solid white, with an appropriate amount of alpha. (glColor(1,1,1,0.5) for instance)
(Should work fine on OpenGL. Seems likely it'll be good on ES, too.)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow