GL_OES_blend_subtract#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT

Valid APIs#

OpenGL ES 1.x

Description#

OpenGL ES 1.x has functionality allowing various basic blending functions to occur via glBlendFunc, by allowing the user to pick the source and destination values used in blend calculations. This feature enables further specification of how blending works by adding a new function - glBlendEquationOES, which allows a developer to specify, further what actually happens to those values once they have been selected. Usual GL operation adds the values together, using “GL_FUNC_ADD_OES” as a default. Two new modes are included by this function; “subtraction” and “reverse subtraction”.

The equations used look as follows:

  • GL_FUNC_ADD_OES:

    • Result = Source + Destination

  • GL_FUNC_SUBTRACT_OES:

    • Result = Source - Destination

  • GL_FUNC_REVERSE_SUBTRACT_OES:

    • Result = Destination - Source

This extension is further extended by GL_OES_blend_equation_separate.

Note#

This extension is part of the OpenGL ES 1.x Extension Pack Specification and is core functionality in OpenGL ES 2.0 and 3.0.

Example#

// Set the blend equation to use additive blending
glBlendEquation(GL_FUNC_ADD_OES);
// Set the blend equation to use subtractive blending: source - destination
glBlendEquation(GL_FUNC_SUBTRACT_OES);
// Set the blend equation to use reverse subtractive blending: destination - source
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT_OES);