I want to add instancing to my WebGL application, which works fine using gl_InstanceID
for devices running WebGL2. However, I want to also support older devices running WebGL1 - apparently this is available as an extension for OpenGLES2.0 (see here):
#extension GL_EXT_draw_instanced : enable
#define gl_InstanceID gl_InstanceIDEXT
However, it doesn't look like WebGL1 supports this extension (at least not on the devices I've tested with). Is the list at MDN the canonical list? Is there another way to support instancing for WebGL? I found this thread that has someone offering an implementation, but unfortunately the links are dead.
The official canonical list for WebGL extensions can be found here: https://registry.khronos.org/webgl/extensions/
WebGL1 does support instancing through the ANGLE_instanced_arrays
extension (MDN page). It has the same functionality and API(postfixed with ANGLE
) as the WebGL2 default functionality, however GLSL ES 1.0 does not support gl_InstanceID
so you'll have to implement a work around if you require it.