Skip to content

TilesRenderer: Handle ending raycast traversal early#546

Merged
gkjohnson merged 4 commits into
masterfrom
raycast-optimization
May 9, 2024
Merged

TilesRenderer: Handle ending raycast traversal early#546
gkjohnson merged 4 commits into
masterfrom
raycast-optimization

Conversation

@gkjohnson
Copy link
Copy Markdown
Contributor

@gkjohnson gkjohnson commented May 9, 2024

Fix #416
Related to mrdoob/three.js#27709

If a three.js version greater than r165 then we can use the new ability to exit raycast traversal early (mrdoob/three.js#27709) which will improve performance and allow for custom raycast functions.

Raycasting in an extreme case (close mesh, error target of 10) results in improvements from ~1.8-2.1ms to ~0.2ms for a raycast.

TODO

  • Add a function for retrieving whether r165 has been used.

cc @AlaricBaraou

@gkjohnson gkjohnson merged commit 6703174 into master May 9, 2024
@gkjohnson gkjohnson deleted the raycast-optimization branch May 9, 2024 13:04
@mrdoob
Copy link
Copy Markdown

mrdoob commented May 29, 2024

Sorry, changed the logic in mrdoob/three.js#28520 🙏

@gkjohnson
Copy link
Copy Markdown
Contributor Author

Thanks I'll make a new release once r165 is out

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.

Optimize Raycast path slower due to three.js overhead

2 participants