Reading the WebGL API, I came across WEBGL_draw_buffers extension, which is defined as:
The
WEBGL_draw_buffers
extension is part of the WebGL API and enables a fragment shader to write to several textures, which is useful for deferred shading, for example.
That means we could output to multiple textures with a single fragment shader!
void main(void) {
gl_FragData[0] = vec4(0.25);
gl_FragData[1] = vec4(0.5);
gl_FragData[2] = vec4(0.75);
gl_FragData[3] = vec4(1.0);
}
This would be super helpful for some post-processing pipelines. Is possible to achieve this with Three.js? If so, does anybody know of an example that I can dig through?