glEnable(GL_ALPHA_TEST); // Enable alpha testing glAlphaFunc(GL_GREATER, 0.5f); // Set threshold for alpha testing
glEnable(GL_BLEND); // Enable blending glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Set blending functionIn this code, the blending function takes into account the alpha values of the pixels. The source alpha value is multiplied by the source color value, and the result is added to the destination color value multiplied by one minus the source alpha value. The GL AlphaFunc is a part of the graphics libraries used for 2D and 3D rendering, like Open GL, OpenGL Core or OpenGL ES.