Hey there, I’ve been working on some procedural generation and managed to incorporate some static batching magic in the process, however recently im experimenting with pooling my generated objects as you navigate through the scene. Is there any way to statically batch a group of objects when not being used in a pooling system, then rebatch them when they are?
They are all static objects (trees, rocks etc) when active outside of the pool, but when they go back into the pooling system i want to assign a different position for a group, then re batch.
Static batching is just that, static. If an object is marked for static batching, then a combined mesh is built with all static batching objects, and saved when making a build. The static property is consequently editor-only.
–Eric
Thanks Eric, but is there a way to de combine statically batched objects at runtime as well as re combining them? The StaticBatchingUtility only has one function for combining meshes, I wish to reuses these individual objects when they are sent back into the pool and re assigned a different position, then batched once again. Only to repeat the process. Similar to a treadmill system.
Could you destroy the combined mesh and assign its original mesh when necessary?