3DStreet / 3dstreet

🚲🚢🚌 Web-based 3D visualization of streets using A-Frame
https://3dstreet.app
Other
256 stars 33 forks source link

`enableClipping` slows down app #884

Open kfarr opened 9 hours ago

kfarr commented 9 hours ago

When setting "enableClipping" true on geospatial layers you can notice stuttering or "jumping" in the UI and camera movement when zooming or double-clicking on an object.

The stuttering appears to match the 250s throttled tick in the new obb-clipping component. traversing all the tiles to apply the clipping planes is a super expensive operation. perhaps we could store the previous values and only apply traverse to apply clipping planes if the previous values actually changed?

Also, in addition to monitoring for pose changes on target object, we can monitor for tiles loaded events from 3dtiles runtime object via threejs-loader-tiles library, see: https://github.com/nytimes/three-loader-3dtiles/issues/165#issuecomment-2134763490

rahulkgupta commented 7 hours ago

Diego had some good points in https://github.com/3DStreet/3dstreet/pull/882#pullrequestreview-2341502216 that might resolve this

kfarr commented 1 hour ago

Re: Diego's comments:

Changes to obb-clipping component (or as new component):

[1] https://github.com/nytimes/three-loader-3dtiles/blob/dev/docs/three-loader-3dtiles.loaderoptions.contentpostprocess.md