From what I understand there is no built in dynamic batching at this time, and that’s ok.
I would like to write a custom batching for my game. The levels are procedurally composed of many different meshes that share the same material. I’m seeing hundreds of draw calls as a result.
My question is, what’s the ideal or most likely way of writing a custom mesh batching? Which functions do I call to access the mesh data from 2 meshes, and how do I put them together into a single one. Should I create a new one? Or move from one into the other? Perhaps there is an easy way to take one mesh and stuff it into another entity, to reduce draw calls?
I tried using the pc.MeshInstances, and moving the mesh instance from one entity into the mesh instance array of the second entity, but that didn’t do anything.
I am currently looking at manipulating the pc.VertexBuffer to achieve the batching, but wanted to check if there is a recommended approach. Possibly simpler than manipulating Array Buffers.
Thanks!