So far I'm struggling to find a good use case in the context of babylon as this requires to be able to render from the same vertex and index buffers using different offsets and counts which does not happen a lot for us :(
Closing for now as we are not seeing a direct use in bjs for now
I am writing a CAD application on the web. This feature is very useful for me.
E.g:
There may be a lot of lines in the CAD. Generally, each line is controlled by a separate object in the CAD. When drawing the line, if it is not merged into one object to draw, then the number of drawcall will be very large. This will increase performance loss.
As mentioned in the proposal:
CAD vendors rendering large models compiled of many individual parts face singular issues large numbers of draw calls from WebGL. This extension reduces draw call overhead by standing better batching.
If you can support this feature, then it is very cool.
Why not using instances in that specific case?
@deltakosh
Sometimes you can use an instance, but sometimes it doesn't work.
For example, polygons, each polygon is different.
I would need to see a live example to better understand :)
if you can create a repro in the playground of what could be accelerated by supporting this extension
https://www.babylonjs-playground.com/#7TPP9A
This example may be a bit extreme and the entity is duplicated.
Generally, if you are using duplicate entities, it is no problem to use instantiated geometry.
But in CAD drawings, these graphics may be different.
And the CAD system needs to manage each entity, which means it may be dynamic,
May add points or delete points,
May erase the object and redraw the object.
May draw new objects.
May modify the material (or line type, color)
If the materials are the same, manage these objects automatically, it's cool.
Ok understood!
I saw the webGPU demo, can webgpu solve similar problems?
Not really as the idea is technically to merge multiple vertex buffers into one draw call
馃槃 I think this should improve performance.
Is there any plan to support it? Or is there any other solution to solve this problem?
I will reopen the feature request..Will see ho to add it in our current roadmap :)
Would this help for submeshes? Say I have a mesh with 20 submeshes, and 10 are active. If I understand correctly this could draw all 10 with 1 draw call.
Only if they have the same material
Yeah, something like O(nmaterials) if submeshes are batched, rather than O(nactivesubmeshes) currently.
It would be useful in my case where I have chunks of voxel terrain sharing the same material, as currently I have to make a trade-off between better culling and fewer draw calls.
If you want, you can send a PR for that feature (We do not plan to work on it asap but I will gladly review a PR for it)
Yeah maybe next year, once this ext has shipped in chromium at least. Chrome tracking : Firefox tracking.
Up?
It seems no browsers are currently supporting this extension, at least not Chrome/Firefox in Windows (in their standard mode)...
Maybe we should close the issue until at least one browser supports the extension?
Might be only in Chrome Canary ??? https://twitter.com/Tojiro/status/1099056933783457797 If it is the case it is probably worth adding a note here, closing it and reopening once available ?
From what I could gather, it's only available under a switch for Chrome (which is not "on" by default).
I checked here that's the extension is not available for me in Chrome/Firefox. My GPU is a GTX 1080, so I think it would support it if the browsers would make it available.
Ok do let s close the issue until the extension gets a wider availability. Thanks a ton for checking.
Most helpful comment
I will reopen the feature request..Will see ho to add it in our current roadmap :)