Hello,
I wondering that is the best way to batch meshes to draw them with one draw call. Meshes move separetly, share the same material but with different UVs. Currently i’m changing UV in this way:
mesh.updateVerticesData(VertexBuffer.UVKind, uvs)
Is there any batch mechanism in babylon, for example so assign some batchGroupId or something?
Unfortunately, this wont work cause i need to have possibility to move separate meshes and display different part of big texture for each mesh(controlling UVs)
But I have a plan to let users define more than the world matrices as difference.
If you want, you can give me a repro in the PG and I will use it to improve our instance support to let users change uvs as well
One more comment, in general i’m trying to simulate 2D sprites but maybe i’m doing sth wrong. I used this approach cause i figured that sprites are kind limited compared to mesh(ie. cannot give them parent). I very like Babylon but would love it for a bit better support for 2D
Cool thanks a lot @Deltakosh@jerome. will test it over the weekend.
Btw, what your thoughts about adding high level API for such batching. i.e mesh.batchId = XXX. And all meshes with same id(if they have same material) are batched togheter?
@Deltakosh
Any plan to provide more abstraction for the final user about instance extra properties (colors, uvs) than using manually a VertexBuffer ?
something like :
instance.position,
instance.rotation, instance.color (Color4),
instance.uvs(Vector4)
a bit the same way these properties are set in the SPS for example.
[EDIT] it seems that’s what they did it, by our neighbourg three-instanced-mesh - npm
Well, until now, they haven’t got a real instancedMesh, just some low level instancedBufferGeometry to manage manually.
Unfortunately, I can’t for now : still too busy with my own work … and still two missing features (coming soon, I hope) to add to the SPS. Plus the doc of all of this.
Hello, Thank you guys, i really appreciate. I think hight level API is very useful if you start with new tech and want to R&D it to check if fits our needs.