[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [3D Web] Re: [Public WebGL] Geometry instancing support (ie. draw*Instanced)
- To: firstname.lastname@example.org
- Subject: Re: [3D Web] Re: [Public WebGL] Geometry instancing support (ie. draw*Instanced)
- From: Mark Barnes <email@example.com>
- Date: Thu, 22 Apr 2010 04:07:28 -0700
- In-reply-to: <4BCF9B77.firstname.lastname@example.org>
- 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> <4BCF9B77.firstname.lastname@example.org>
- Sender: email@example.com
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.
Sr Software Architect, Biodroid
Khronos COLLADA work group chairman
On Wed, Apr 21, 2010 at 5:42 PM, Arun Ranganathan <firstname.lastname@example.org>
On 3/11/10 10:57 AM, Cedric Vivier wrote:
On Fri, Mar 12, 2010 at 2:21 AM, Cedric Vivier<email@example.com> wrote:
The addition of the possible usage of gl_InstanceID in shaders would be a
E.g / proposal :
paragraph in the "Differences between WebGL and OpenGL ES 2.0" section.
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 strongly disagree?