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

RE: [3D Web] Re: [Public WebGL] Geometry instancing support (ie. draw*Instanced)

Draw_instanced, which is the spec that corresponds to what has been called geometry instancing in these discussions, is on the list of features for inclusion in the next version of OpenGL ES. Any other divergences I might credibly be able to bring up in the ES/desktop convergence meetings though it might be considered a little off topic. The only other I heard mentioned was premultiplied alpha. I’m not sure that’s really appropriate for ES, but going forward any such things could be delivered through that channel.




From: owner-public_webgl@khronos.org [mailto:owner-public_webgl@khronos.org] On Behalf Of Mark Barnes
Sent: Thursday, April 22, 2010 4:07 AM
To: public_webgl@khronos.org
Subject: Re: [3D Web] Re: [Public WebGL] Geometry instancing support (ie. draw*Instanced)


If it's good for WebGL then is it also good for GLES 2? Some due diligence is implied here.

If so then I recommend making it a proper extension so that both specs can benefit.

ps: likewise for other divergences.


Mark Barnes
Sr Software Architect, Biodroid
Khronos COLLADA work group chairman

On Wed, Apr 21, 2010 at 5:42 PM, Arun Ranganathan <arun@mozilla.com> wrote:

On 3/11/10 10:57 AM, Cedric Vivier wrote:

On Fri, Mar 12, 2010 at 2:21 AM, Cedric Vivier<cedricv@neonux.com>  wrote:


The addition of the possible usage of gl_InstanceID in shaders would be a
paragraph in the "Differences between WebGL and OpenGL ES 2.0" section.


E.g / proposal :

void drawArraysInstanced(in GLenum mode, in GLint first, in GLsizei count,
in GLsizei primcount) raises(DOMException);
void drawElementsInstanced(in GLenum mode, in GLsizei count, in GLenum type,
in GLsizeiptr offset, in GLsizei primcount) raises(DOMException);


drawArraysInstanced(mode, first, count, primcount) (EXT_draw_instanced man

drawElementsInstanced(mode, count, type, offset, primcount)
(EXT_draw_instanced man page)
Draw given primcount instances using the currently bound index array. The
given offset is in bytes, and must be a valid multiple of the size of the
given type or an INVALID_VALUE error will be raised. Shader variable
gl_InstanceID is incremented for each instance, from 0 inclusive to
primcount exclusive.

6.2 Geometry instancing

WebGL adds instanced draw calls drawArraysInstanced and
drawElementsInstanced, consequently gl_InstanceID is a valid vertex shader
input variable that holds the integer index of the current primitive in an
instanced draw call. If the current primitive does not come from an
instanced draw call, the value of gl_InstanceID is zero.


I'm in favor of adding these changes to WebGL 1.0.

On our conference call, we discussed whether or not this should be done via extension or directly as part of WebGL.

On the one hand, we're always hesitant to increase the delta between OpenGL ES 2.0 and WebGL.  But on the other hand, I *really* like the performance gains by doing this.  I think doing this as part of the specification makes sense.  Such an inclusion isn't the norm, however.  It *is* important to "feature freeze" especially as we approach 1.0.  Here, however, I'm certainly prepared to make an exception and include this in the specification.

I'm ok with Cedric's text for inclusion in the spec.  Does anyone strongly disagree?

-- A*