Using texture as alpha mask to apply transparency

This Solved the problem.
– set GL version to 3.2. as hamoid suggested –
then the code below does what is expected.

mask.getTexture().setSwizzle(GL_TEXTURE_SWIZZLE_A, GL_RED);

The shader example from roymacdonald also has GL set to 3.2, (though there is a test in the example and uses different shaders depending upon GL Version)

good to know.

Hi, I’m bumping this thread because I’m trying these methods on a Raspi and none of them work.

When I use the swizzle thing, it can’t find the constants, so I assume it is not on GLES. But the alpha methods don’t work either. Is there any limitation we should be aware of?


I realize now that there is no alphaMaskingShaderExample in the raspi repo. Maybe maybe I should take this as a bad sign :pensive: