GLGraphics Alpha blending
in
Contributed Library Questions
•
4 months ago
Hi everyone,
I'm new to Processing and eventually developed with Java but new to OpenGL so sorry if this is a very elemental question.
For my testing project, I'm using the codeanticode GLGraphics library and the core OpenGL.
I have a question in how to set the alpha channel of a texture to blend with another. Both textures will be drawn with image().
- GLTexturePingPong textureOne;
- GLTexture textureTwo;
textureOne has white background and a red circle on the middle and is semi-transparent (not 100% red).
textureTwo comes from an image.
- image(textureTwo, 0, 0);
- image(textureOne, 0, 0);
As you see I want to place one texture on top of the other but setting the alpha channel of the textureOne in the way that the white texture pixels are considered as "transparent" and the other that are not colored at all "sem-transparent".
Is that possible? Do I have to enable some GLGraphics constants to enable blending? Is there any method like
- textureOne.setAlphaChannel(255);
to consider white as the alpha channel?
Thank you very much,
Adrian.
1