NASA-AMMOS / 3DTilesRendererJS

Renderer for 3D Tiles in Javascript using three.js
https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/mars.html
Apache License 2.0
1.57k stars 281 forks source link

TilesRenderer: Handle ending raycast traversal early #546

Closed gkjohnson closed 4 months ago

gkjohnson commented 4 months ago

Fix #416 Related to https://github.com/mrdoob/three.js/pull/27709

If a three.js version greater than r165 then we can use the new ability to exit raycast traversal early (https://github.com/mrdoob/three.js/pull/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

cc @AlaricBaraou

mrdoob commented 4 months ago

Sorry, changed the logic in https://github.com/mrdoob/three.js/pull/28520 🙏

gkjohnson commented 4 months ago

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