OES_draw_buffers_indexed
WebGL working group (public_webgl 'at' khronos.org)
Alexey Knyazev
Members of the WebGL working group
Last modified date: November 04, 2021
Revision: 6
WebGL extension #45
Written against the WebGL API 2.0 specification.
This extension exposes the OES_draw_buffers_indexed functionality to WebGL.
The following WebGL-specific behavioral changes apply:
CONSTANT_COLOR or ONE_MINUS_CONSTANT_COLOR are used as blend color factors of an active draw buffer and
CONSTANT_ALPHA or ONE_MINUS_CONSTANT_ALPHA are used as blend color factors of another active draw buffer,
any draw call will generate an INVALID_OPERATION error.
isEnablediOES entry point.
Consult the above extension for documentation, issues and new functions and enumerants.
When this extension is enabled:
[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface OES_draw_buffers_indexed {
undefined enableiOES(GLenum target, GLuint index);
undefined disableiOES(GLenum target, GLuint index);
undefined blendEquationiOES(GLuint buf, GLenum mode);
undefined blendEquationSeparateiOES(GLuint buf,
GLenum modeRGB, GLenum modeAlpha);
undefined blendFunciOES(GLuint buf,
GLenum src, GLenum dst);
undefined blendFuncSeparateiOES(GLuint buf,
GLenum srcRGB, GLenum dstRGB,
GLenum srcAlpha, GLenum dstAlpha);
undefined colorMaskiOES(GLuint buf,
GLboolean r, GLboolean g, GLboolean b, GLboolean a);
};
Enables blending for an individual draw buffer.
target must be BLEND.
index is an integer i specifying the draw buffer associated with
the symbolic constant DRAW_BUFFERi.
Disables blending for an individual draw buffer.
target must be BLEND.
index is an integer i specifying the draw buffer associated with
the symbolic constant DRAW_BUFFERi.
The buf argument is an integer i that indicates that the blend equations
should be modified for DRAW_BUFFERi.
mode accepts the same tokens as mode in blendEquation.
The buf argument is an integer i that indicates that the blend equations
should be modified for DRAW_BUFFERi.
modeRGB and modeAlpha accept the same tokens as modeRGB
and modeAlpha in blendEquationSeparate.
The buf argument is an integer i that indicates that the blend functions
should be modified for DRAW_BUFFERi.
src and dst accept the same tokens as src and
dst in blendFunc.
The buf argument is an integer i that indicates that the blend functions
should be modified for DRAW_BUFFERi.
srcRGB, dstRGB, srcAlpha, and dstAlpha accept the same
tokens as srcRGB, dstRGB, srcAlpha, and dstAlpha parameters in
blendEquationSeparate.
The buf argument is an integer i that indicates that the write mask
should be modified for DRAW_BUFFERi.
r, g, b, and a indicate whether R, G, B, or A
values, respectively, are written or not (a value of TRUE means that the corresponding value is written).
New allowed target tokens and their return types are given in the following table.
| target | returned type |
|---|---|
| BLEND_EQUATION_RGB | GLenum |
| BLEND_EQUATION_ALPHA | GLenum |
| BLEND_SRC_RGB | GLenum |
| BLEND_SRC_ALPHA | GLenum |
| BLEND_DST_RGB | GLenum |
| BLEND_DST_ALPHA | GLenum |
| COLOR_WRITEMASK | sequence<GLboolean> (with 4 values) |
index is an integer i specifying the draw buffer associated with
the symbolic constant DRAW_BUFFERi.
WEBGL_blend_equation_advanced_coherent.
Revision 1, 2019/01/24
Revision 2, 2019/01/30
Revision 3, 2019/09/25
Revision 4, 2020/03/05
OES_draw_buffers_indexed.Revision 5, 2020/06/25
isEnablediOES.Revision 6, 2021/11/04