I’ve got a scene with a lot of meshes. Performance wasn’t too good and I only actually need a few meshes on screen at one time. So I created an octree for the scene using
scene.createOrUpdateSelectionOctree() which worked wonderfully!
The issue I have now is that whenever I add or remove a mesh from the scene (a static one, not a dynamic one) I have to call
scene.createOrUpdateSelectionOctree() again, which takes about 100ms for the call to complete and the scene skips.
I need to keep these meshes as static to keep the performance gains of the octree over time.
Is there a better way to do this?
As a side question: Is there also a better way to handle dynamic content in the scene octree?. I am adding and removing meshes from
scene.selectionOctree.dynamicContent all the time. I add a mesh and it doesn’t show and I then I remember I have to add it to the dynamic content array too, or rebuild the octree.
So it really goes to the topic question. Is there a way to optimise the octree for updates? Both in performance and API?