OpenGL ES 2.0 blending alpha limit

172 Views Asked by At

Is there a blending method in OpenGL ES 2.0 for setting a limit on the blended alpha value? I want to achieve an effect where textures get blended normally when drawn on top of each other, until an alpha limit is reached, at which point the blended alpha value would stop increasing.

1

There are 1 best solutions below

0
Amendale On BEST ANSWER

I was able to achieve this effect using:

glBlendColor(0, 0, 0, 1-myLimit);
glBlendFunc(GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Seems to achieve the desired effect.