Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enableClipping slows down app #884

Closed
kfarr opened this issue Oct 1, 2024 · 3 comments
Closed

enableClipping slows down app #884

kfarr opened this issue Oct 1, 2024 · 3 comments

Comments

@kfarr
Copy link
Collaborator

kfarr commented Oct 1, 2024

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: nytimes/three-loader-3dtiles#165 (comment)

@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in 3DStreet Dev Tracking Oct 1, 2024
@kfarr kfarr moved this from Backlog (Not Ready) to To Do - High Prio in 3DStreet Dev Tracking Oct 1, 2024
@rahulkgupta
Copy link
Collaborator

Diego had some good points in #882 (review) that might resolve this

@kfarr
Copy link
Collaborator Author

kfarr commented Oct 2, 2024

Re: Diego's comments:

  • Yes we should only update planes & apply on matrix movements, same as bounding box calc
  • However, the 3dtiles are constantly updating from perspective and LOD changes, if we don't apply planes every tick, there will be new tiles that pop in without the clipping planes applied
  • An alternative to checking every tick, we can hook into contentPostProcess event [1] that is emitted from the 3dtiles
  • This is modified in the aframe-3dtiles-component repo -- i just finished this here: 3DStreet/aframe-loader-3dtiles-component@339b735#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346

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

  • apply clipping planes to the returned mesh of the new tiles upon emitting 'contentPostProcess
  • instead of traversing the entire tree just apply the clipping planes to that

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

@kfarr
Copy link
Collaborator Author

kfarr commented Oct 9, 2024

closed by #887 887

@kfarr kfarr closed this as completed Oct 9, 2024
@github-project-automation github-project-automation bot moved this from For Review to Done in 3DStreet Dev Tracking Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants