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

Re: [Public WebGL] The state of MRTs

Indeed, the spec is all setup to support multiple render targets, but explicitly doesn't (just like ES 2). gl_FragData is an array, and framebufferTexture2D and framebufferRenderbuffer allow you to specify multiple targets in an extensible way. The only thing in the spec that prevents it is the explicit mention that COLOR_ATTACHMENT0 is the only allowed color attachment. I have a feeling this was designed intentionally so that an extension could easily simply define COLOR_ATTACHMENT1 and the spec would be all ready for MRT.

Whether anybody will ever implement such an extension for WebGL, or whether it would become standard, I have no idea. I would work on designing whatever it is you are doing not to need MRT unless you don't care about supporting the lowest common denominator (or in this case potentially the majority).


On Tue, Mar 20, 2012 at 10:59 AM, Paul Lewis <paul@aerotwist.com> wrote:
gl_FragData is an array and IS part of GLSL ES

gl_FragData[0]  is the same as gl_FragColor

Interesting. So the question then is whether that could or will be extended? I'd personally appreciate the ability to write to multiple draw buffers but I appreciate the reasons to date that have precluded its inclusion.