Status of the base instance extensions?

61 views
Skip to first unread message

Kari Lavikka

unread,
Dec 22, 2023, 5:56:10 AM12/22/23
to webgl-d...@googlegroups.com
Hi,

What's the status of the WEBGL_draw_instanced_base_vertex_base_instance extension, which is in draft state and hasn't been updated for two years? It seems available in Chrome upon enabling the "WebGL Draft Extensions" flag.

My use case: I have a large buffer comprising hundreds of concatenated "slices," each representing a varying number of instanced meshes. I'm rendering different combinations of these slices.

Because gl.drawArraysInstanced does not support the baseInstance parameter, I have worked around the limitation by calling vertexAttribPointer with a suitable offset for each buffer before the draw call. There are also other possible techniques, but none of them is perfect.

While the baseInstance would allow for reducing the number of WebGL calls from ~4000 to ~1500 with my data set, the multi-draw variant of the extension would be fantastic – only a few calls would be enough. Multi draw without base instances cannot be used in this situation.

Here's a snippet that demonstrates the use of the extension when available:
https://github.com/genome-spy/genome-spy/blob/1de9e1844a0bc23117f4ed82e781618f5a4deb1c/packages/core/src/marks/link.js#L188

For those interested, here's a video of the use case: https://twitter.com/KariLavikka/status/1735651512053850590 (I'm rendering a large number of arcs using Bézier curves. The slices represent different samples that are shown as horizontal "tracks".)

Best,
Kari

Ivan Popelyshev

unread,
Mar 9, 2024, 10:48:00 AMMar 9
to WebGL Dev List
Hi! I use BVBI in my project tesera.io . I asked Ken about year ago, he told me that it needs good test, to show the case where it actually helps. I dont know how can we show that 10% CPU of "glVertexAttribPointer" in worse case in my project is bad :( I have an idea how to make strange test that is totally disconneted from real cases, though im too busy to implement it :(

пятница, 22 декабря 2023 г. в 13:56:10 UTC+3, tune...@gmail.com:

Oleksandr Popov

unread,
Mar 10, 2024, 3:49:48 AMMar 10
to WebGL Dev List
Hello,
I used BVBI in my web demo, this extension works on PC but is not available on mobile devices.

Oleksandr Popov

unread,
Mar 10, 2024, 3:55:26 AMMar 10
to WebGL Dev List
https://github.com/keaukraine/webgl-rock-pillars here is link to my project which uses BVBI.

Kari Lavikka

unread,
Mar 13, 2024, 3:02:24 AMMar 13
to webgl-d...@googlegroups.com
Hi,

TBH, glVertexAttribPointer is not a bottleneck at all in my project. Using multi-draw to reduce the number of vertexAttribPointer and drawArraysInstanced calls could improve the performance a bit. However, I don't have any performance metrics to provide as I have yet to adopt the multi-draw-based method. I'm not expecting massive gains with that, however.

Best,
Kari

Alexander Rose

unread,
Mar 18, 2024, 9:50:05 PMMar 18
to WebGL Dev List
There is an ANGLE issue and I posted my use case and some performance numbers there https://bugs.chromium.org/p/angleproject/issues/detail?id=3402#c38
Reply all
Reply to author
Forward
Message has been deleted
0 new messages