WebGL
Khronos
 

WebGL OES_draw_buffers_indexed Extension Draft 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: June 25, 2020
Revision: 5

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

[NoInterfaceObject]
interface OES_draw_buffers_indexed {
  void enableiOES(GLenum target, GLuint index);

  void disableiOES(GLenum target, GLuint index);

  void blendEquationiOES(GLuint buf, GLenum mode);

  void blendEquationSeparateiOES(GLuint buf,
                                 GLenum modeRGB, GLenum modeAlpha);

  void blendFunciOES(GLuint buf,
                     GLenum src, GLenum dst);

  void blendFuncSeparateiOES(GLuint buf,
                             GLenum srcRGB, GLenum dstRGB,
                             GLenum srcAlpha, GLenum dstAlpha);

  void colorMaskiOES(GLuint buf,
                     GLboolean r, GLboolean g, GLboolean b, GLboolean a);
};
  

New Functions

void 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.

void 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.

void 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.

void 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.

void 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.

void 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.

void 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