[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Geometry instancing support (ie. draw*Instanced)
- To: public webgl <firstname.lastname@example.org>
- Subject: Re: [Public WebGL] Geometry instancing support (ie. draw*Instanced)
- From: Arun Ranganathan <email@example.com>
- Date: Wed, 21 Apr 2010 17:42:31 -0700
- In-reply-to: <firstname.lastname@example.org>
- Organization: Mozilla Corporation
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <4231566F-0690-48B7-B9BB-7FD43B860546@apple.com> <email@example.com> <9E5FC525-3DA4-4483-BC53-FE0582D9E550@apple.com> <firstname.lastname@example.org> <email@example.com>
- Reply-to: Arun Ranganathan <firstname.lastname@example.org>
- Sender: email@example.com
- User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:220.127.116.11) Gecko/20100317 Thunderbird/3.0.4
On 3/11/10 10:57 AM, Cedric Vivier wrote:
On Fri, Mar 12, 2010 at 2:21 AM, Cedric Vivier<firstname.lastname@example.org> 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
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
You are currently subscribe to email@example.com.
To unsubscribe, send an email to firstname.lastname@example.org with
the following command in the body of your email: