This extension exposes the KHR_blend_equation_advanced_coherent functionality to WebGL.
CanvasRenderingContext2D provides a series of common blend functions with globalComposeOperation, such as "multiply" and "screen". KHR_blend_equation_advanced_coherent provides, with the exception of "xor", exactly the same list of blend functions for WebGL, as detailed below:
These effects are useful for high-quality artistic blends. They can be implemented using shaders and rendering via an intermediate texture. However this has a high performance overhead both in draw calls and GPU bandwidth. Advanced blend modes allow a much simpler, high-performance way of implementing these blends. Using shaders rendering to an intermediate texture can be used as a fallback if this extension is not supported.
Note only the coherent variant of this extension is exposed in order to eliminate the possibility of undefined behavior in KHR_blend_equation_advanced. This also simplifies the extension and removes the need to insert blend barriers during rendering.
blendEquation
entry point is extended to accept the enums in the IDL belowvar ext = gl.getExtension("WEBGL_blend_equation_advanced_coherent"); gl.blendEquation(ext.MULTIPLY); gl.getParameter(gl.BLEND_EQUATION) == ext.MULTIPLY;