Automatically updating bounds casues performance issues
https://github.com/pex-gl/pex-renderer/blob/079742f59fa0f0e14e0db0daeb5ee9698ef50d8e/systems/geometry.js#L175
Leaning toward the freeze naming as Babylon.js uses it, JS Object.freeze and it could be used for material.freeze as well (although for this issues, Babylon.js has mesh.doNotSyncBoundingInfo = true; but no thank you). But not sure if it is freeze flag list or freeze object or freeze bool:
geometry.freeze = true;
geometry.freeze = new Set(['bounds', 'attributes']);
geometry.freeze = {
bounds: true,
attributes: ['aPosition']
}
Well freeze sounds like readOnlyDoNotTouch while i need doNotUpdateIllDoItMyself. Bit different.
My use case allows for updating bounds when e.g. landscape changes but now while it animates. Freeze sounds like object from gltf that has it precomputed.
Conclusion: let's remove the automatic recomputation of bounds and rely on manually setting bounds.dirty. (done in a996e10848018d1de68d88733a0b5b5b6e0f883c for 4.0.0-alpha.56)
Should morph set bounds.dirty automatically though?
- [ ] Morph: should we set a autoUpdate/freeze or assume the provided bounding encapsulates all animation states positions/offsets
https://github.com/pex-gl/pex-renderer/blob/cb08effeafc062489cbb1942115306294a4c218c/systems/morph.js#L50-L51