WEBGL_blend_func_extended
WebGL working group (public_webgl 'at' khronos.org)
Members of the WebGL working group
Last modified date: January 11, 2024
Revision: 2
WebGL extension #58
Written against the WebGL API 1.0 specification.
This extension exposes the EXT_blend_func_extended functionality to WebGL.
The following WebGL-specific behavioral changes apply:
#extension GL_EXT_blend_func_extended
directive to use its functionality in shaders.
Likewise the shading language preprocessor #define GL_EXT_blend_func_extended,
will be defined to 1 if the extension is supported.
INVALID_OPERATION is generated by attempting to draw
when any of the SRC1 blend factors are used for an active draw buffer,
which has blending enabled, and the fragment shader does not
gl_SecondaryFragColorEXT
or to the appropriate element of the gl_SecondaryFragDataEXT[] array.
Consult the above extension for documentation, issues and new functions and enumerants.
When this extension is enabled:
GL_EXT_blend_func_extended with an #extension directive:int gl_MaxDualSourceDrawBuffersEXT is a built-in constant.
gl_SecondaryFragColorEXT and
gl_SecondaryFragDataEXT[] are built-in outputs.
index layout qualifier may be
used to bind fragment shader outputs as secondary blend sources.
GL_EXT_blend_func_extended
is defined as 1.
[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WEBGL_blend_func_extended {
const GLenum SRC1_COLOR_WEBGL = 0x88F9;
const GLenum SRC1_ALPHA_WEBGL = 0x8589;
const GLenum ONE_MINUS_SRC1_COLOR_WEBGL = 0x88FA;
const GLenum ONE_MINUS_SRC1_ALPHA_WEBGL = 0x88FB;
const GLenum MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL = 0x88FC;
};
New enums SRC1_COLOR_WEBGL, SRC1_ALPHA_WEBGL,
ONE_MINUS_SRC1_COLOR_WEBGL, and ONE_MINUS_SRC1_ALPHA_WEBGL are accepted
as the src and dst parameters.
WebGL 1.0: An existing enum SRC_ALPHA_SATURATE is accepted
as the dst parameter.
New enums SRC1_COLOR_WEBGL, SRC1_ALPHA_WEBGL,
ONE_MINUS_SRC1_COLOR_WEBGL, and ONE_MINUS_SRC1_ALPHA_WEBGL
are accepted as the srcRGB, dstRGB, srcAlpha,
and dstAlpha parameters.
WebGL 1.0: An existing enum SRC_ALPHA_SATURATE is accepted
as the dstRGB and dstAlpha parameters.
SRC1_COLOR_WEBGL,
SRC1_ALPHA_WEBGL, ONE_MINUS_SRC1_COLOR_WEBGL, and
ONE_MINUS_SRC1_ALPHA_WEBGL are accepted as the src and dst
parameters.
SRC1_COLOR_WEBGL,
SRC1_ALPHA_WEBGL, ONE_MINUS_SRC1_COLOR_WEBGL, and
ONE_MINUS_SRC1_ALPHA_WEBGL are accepted as the srcRGB,
dstRGB, srcAlpha, and dstAlpha parameters.
New MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL enum is accepted as the pname parameter.
The return type of this method depends on the parameter queried:
| pname | returned type |
|---|---|
| MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL | GLint |
Revision 1, 2023/06/01
Revision 2, 2024/01/11