[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] The state of MRTs



On Tue, Mar 20, 2012 at 3:32 PM, Paul Lewis <paul@aerotwist.com> wrote:
So I was wondering what the state of play is regarding multiple render targets. I understand that they're in the 1.0 specification, but due to lack of ubiquitous hardware support (as in the case of mobile) it's not implemented anywhere. Is my understanding correct?
MRTs are not in the WebGL 1.x specifications.

The basics first, MRTs are defined across three desktop OpenGL extensions:
http://www.opengl.org/registry/specs/ARB/draw_buffers.txt This specifies that one can attach multiple color output buffers to a framebuffer and that GLSL may use gl_FragData[N]
http://www.opengl.org/registry/specs/EXT/draw_buffers2.txt Depends on DRAW_BUFFERS, Allows to specify separate blending (enable/disable) and write masks for each color output buffer
http://www.opengl.org/registry/specs/ARB/draw_buffers_blend.txt Depends on DRAW_BUFFER2, Allows to specify separate blend func and blend equation for each color output buffer

OpenGL ES defines some MRT extensions:
http://www.khronos.org/registry/gles/extensions/NV/GL_NV_draw_buffers.txt Vendor specific (NV), the equivalent of DRAW_BUFFER for desktops
http://www.khronos.org/registry/gles/extensions/NV/GL_NV_fbo_color_attachments.txt increases the amount of available attachment points (for whatever reason I can't fathom).

No OES variant of the DRAW_BUFFERS extension has yet been added, although I proposed it there: http://www.khronos.org/message_boards/viewtopic.php?f=9&t=4699

The (WebGL) powers that be decided that WebGL cannot obtain desktop only graphics features. And since mobiles only support MRTs for Nvidia (and not for Apple as well), WebGL cannot have MRTs.

I don't know if the PowerVR chipset family that Apple uses are MRT capable at all (but I suspect they are). I also don't know why an OES_DRAW_BUFFERS hasn't been added to the OpenGL ES extension registry.