pex-renderer icon indicating copy to clipboard operation
pex-renderer copied to clipboard

Automatically updating bounds casues performance issues

Open vorg opened this issue 1 year ago • 2 comments

https://github.com/pex-gl/pex-renderer/blob/079742f59fa0f0e14e0db0daeb5ee9698ef50d8e/systems/geometry.js#L175

vorg avatar Sep 03 '24 13:09 vorg

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']
}

dmnsgn avatar Sep 03 '24 13:09 dmnsgn

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.

vorg avatar Sep 03 '24 16:09 vorg

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

dmnsgn avatar Mar 18 '25 02:03 dmnsgn