Hi all, I have 3 entities representing different LOD for the same static model (house). But the meshes are different (high to low polygons) for all 3, but they use the same material. Can I create a single batch group and use it for all 3 or do I have to create a batch group per LOD so there will be 3 batch groups?
Since there isn’t any support for LOD in the PlayCanvas engine (and specifically in the batcher), you will have to get creative as you say (I’ve done something similar in the past using the PlayCanvas batcher).
You definitely need to have unique batches generated in the batcher per LOD group. Different batch groups or different materials per model can help do that. What I’ve done in the past is used the batcher internal methods to create the batches myself, by passing specific entities to the batcher (it’s not trivial and not fully recommended since it’s difficult to maintain).
From there, you need to find the exact batches generated in the batcher’s list and get a reference to the final mesh instance. To use in your LOD logic to show/hide based on the active level of detail (us the meshInstance.visible property).
Hope that helps.
Thank you @Leonidas that helps so I have to create 3 different batch groups. As far as I understand geometry (mesh) and the material have to be the same in order to use batching?
No for batching the geometry can be different, only the material needs to be the same. You will get one draw call for all geometry, even different models, that use the same material.
Ah I see, thanks!