Sorry, haven’t got much into Playcanvas for the time being, but hmm…
By default, Playcanvas doesn’t support skinned animation batching. If you place them in a batch group, all animations will cease to work. I had to run a hackish code replacement (that isn’t guarenteed to be future proof but as of now it’s working though) in existing projects to get my animated skin batching to work. There were also some considerable issues with regards to the nature of bounding boxes (eg. should it be combined + updated per frame or not???, etc.) for the built-in playcanvas culling visibility checks which meant things became slightly project specific in terms of how conventions go.
Go to the project at (with regards to the above described consideration):
Look for the script
/script/modpc.js . Include this script as the first script in order to modify hack the Playcanvas batching engine to support skinned animations. If you have a bunch of animated character entities, they should all be batched and be able to support independant animations.
Anyway, the fork with the working animated batched can be found at:
To further optimise this, you may wish to avoid the per frame overhead of updating/combining of individual bounding boxes of each animated character by setting the first reference character entity’s meshInstances cull property
meshInstance.cull = false; meshInstance.visible = true to skip updating of certain things for culling checks for the batch. However, if you do this, you sacrifice the built-in camera culling functions and it’s assumed all animated model batches will always attempt to render itself even if camera isn’t facing them, without having to refer to any updated boudning box (of the combined animated skinned meshes). However, doing this by code is rather inconvenient and will not work unless you also manually set up your batches by code as well (only after setting the first reference meshInstance.cull = false, then batching the list of meshInstances manually on your own). Otherwise, you’ve got to go and find the batch (after creation) and update it yourself…to use batch’s meshInstance.cull = false… Bleh… I REALLY wish the Playcanvas editor had ways to modify the .cull properties within the editor itself for batch groups and entities…but alas…no such way of doing so.
In terms of framerate, they can be kinda similar unless you zoom out the camera to view ALL meshInstances, for that the batching always benefits for framerate since with batching all models are combined into 1 single instance unlike the other case where some models may get culled away. ie., without batching , you get the benefit of the built-in culling of individual models’ meshInstances which can help reduce overall polycount which may be good on “some” videocards.