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

fix: pointer move attempts to intersect geometries causing intense lag #3373

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FlafyDev
Copy link

@FlafyDev FlafyDev commented Oct 6, 2024

After adding a OrbitControls to the canvas and loading a relatively big STL file (50mb). Performance is really bad when the pointer is moving over the geometry.

Using Chrome's performance diagnostics tool, I found out that happens because this library attempts to intersect the geometry the pointer is on every pointer move event. Not sure if this is the correct solution, but it cancels the intersection calculations on pointer move.

After adding a OrbitControls to the canvas and loading a relatively big STL file (50mb). Performance is really bad when the pointer is moving over the geometry. Using Chrome's performance diagnostics tool, I found out that happens because this library attempts to intersect the geometry the pointer is on every pointer move event. Not sure if this is the correct solution, but it cancels the intersection calculations on pointer move.
Copy link

codesandbox-ci bot commented Oct 6, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 574ec3e:

Sandbox Source
example Configuration

@FlafyDev
Copy link
Author

FlafyDev commented Oct 6, 2024

Similar thing happens when scrolling(zooming). Maybe it's better to change the condition to if pointer up/down rather than if pointer not moving? Then again, I'm not sure what this intersection is for.

@FlafyDev
Copy link
Author

FlafyDev commented Oct 6, 2024

Even with this change, there is still lag when panning the camera (pointer down and up events). No lag when dragging the camera(pointer move event).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant