WEBGL_multi_draw extension

Draw Calls and WebGL Performance

In WebGL-based applications, each draw call represents a request to render a mesh or a part of a mesh. Drawing multiple objects with separate draw calls can quickly become a performance bottleneck, especially when dealing with scenes containing a large number of objects or complex animations. Reducing the number of draw calls is critical for achieving smooth and responsive 3D experiences on the web.

Link: Optimize Your Scene

WEBGL_multi_draw Extension

The WEBGL_multi_draw extension is an WebGL extension that allows multiple draw calls to be batched together into a single call. This extension has the potential to significantly reduce the overhead associated with issuing individual draw calls, leading to improved rendering performance.




cc @Evgeni_Popov :slight_smile:

According to poki’s report Poki for Developers - Reach the world on web WEBGL_multi_draw has a good support on target devices

Yes, it could be interesting to support this extension (even more so when WebGPU supports it), but we’ll have to find a good design to add it to the engine, as we don’t want to add too much javascript code to support it, which would cancel out the benefit of using the new API…

Maybe something like BatchedMesh of three.js, or InstancedMesh with count and offset. Also, a static api like MergeMeshes would help to convert meshes imported from existing assets.