WebGL
Khronos
 

WebGL OES_draw_buffers_indexed Extension Specification

Name

OES_draw_buffers_indexed

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Alexey Knyazev

Members of the WebGL working group

Version

Last modified date: November 04, 2021
Revision: 6

Number

WebGL extension #45

Dependencies

Written against the WebGL API 2.0 specification.

Overview

This extension exposes the OES_draw_buffers_indexed functionality to WebGL.

The following WebGL-specific behavioral changes apply:

Consult the above extension for documentation, issues and new functions and enumerants.

When this extension is enabled:

IDL

[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);
};
  

New Functions

undefined enableiOES(GLenum target, GLuint index)

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.

undefined disableiOES(GLenum target, GLuint index)

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.

undefined blendEquationiOES(GLuint buf, GLenum mode)

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.

undefined blendEquationSeparateiOES(GLuint buf, GLenum modeRGB, GLenum modeAlpha)

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.

undefined blendFunciOES(GLuint buf, GLenum src, GLenum dst)

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.

undefined blendFuncSeparateiOES(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)

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.

undefined colorMaskiOES(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)

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 Tokens

getIndexedParameter(GLenum target, GLuint index)

New allowed target tokens and their return types are given in the following table.

targetreturned type
BLEND_EQUATION_RGBGLenum
BLEND_EQUATION_ALPHAGLenum
BLEND_SRC_RGBGLenum
BLEND_SRC_ALPHAGLenum
BLEND_DST_RGBGLenum
BLEND_DST_ALPHAGLenum
COLOR_WRITEMASKsequence<GLboolean> (with 4 values)

index is an integer i specifying the draw buffer associated with the symbolic constant DRAW_BUFFERi.

Issues

Describe interaction with WEBGL_blend_equation_advanced_coherent.

Revision History

Revision 1, 2019/01/24

Revision 2, 2019/01/30

Revision 3, 2019/09/25

Revision 4, 2020/03/05

Revision 5, 2020/06/25

Revision 6, 2021/11/04