coderef

WEBGL_draw_buffers WebGL extensionLimited availability

The WEBGL_draw_buffers extension for WebGL 1.0 contexts enables a fragment shader to write to several textures, which is useful for deferred shading, for example.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–35Not supported
36+Supportedsince Jul 16, 2014
Current: 155
Edge
12–16Not supported
17+Supportedsince Apr 30, 2018
Current: 154
Firefox
1–27Not supported
28+Supportedsince Mar 18, 2014
Current: 157
Safari
1–8Not supported
9+Supportedsince Sep 30, 2015
Current: 27
MobileChrome Android
✕Not supportedup to 155
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
1–14.5Not supported
15+Supportedsince Sep 20, 2021
Current: 27

How to use

Not supported in Chrome Android, Firefox Android. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: WEBGL draw buffers.

Feature detection

JS · check before using
if ("WEBGL_draw_buffers" in globalThis) {
  // WEBGL_draw_buffers is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
WEBGL_draw_buffers3617289✕✕15
WEBGL_draw_buffers.drawBuffersWEBGL3617289✕✕15