# Accelerating structures for raycasting against mesh objects

**URL:** <https://forum.babylonjs.com/t/accelerating-structures-for-raycasting-against-mesh-objects/36752>\
**Category:** Questions\
**Created:** [December 21, 2022, 1:53pm UTC](https://forum.babylonjs.com/t/accelerating-structures-for-raycasting-against-mesh-objects/36752 "2022-12-21T13:53:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![querielo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/querielo/32/28878_2.png) [@querielo](https://forum.babylonjs.com/u/querielo)\
**Post date:** [December 21, 2022, 1:53pm UTC](https://forum.babylonjs.com/t/accelerating-structures-for-raycasting-against-mesh-objects/36752/1 "2022-12-21T13:53:50Z")

</div>

I was wondering if there is a library or feature within Babylon.js that allows to use accelerating structures for raycasting against mesh objects (like BVH, octotree). I have a large scene with multiple mesh objects and am experiencing significant performance issues when using the built-in raycaster. Also, it’d be great to be able cast planes on meshes.

I have looked through the documentation and cannot find any mention of this type of feature. Is there a way to optimize raycasting in large scenes with multiple mesh objects, or is there a library that has been developed specifically for this purpose?

Any suggestions or guidance would be greatly appreciated. Thank you!

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 21, 2022, 3:45pm UTC](https://forum.babylonjs.com/t/accelerating-structures-for-raycasting-against-mesh-objects/36752/2 "2022-12-21T15:45:12Z")

</div>

Hello! There is the possibility of using octrees: [Optimizing With Octrees | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeOctrees#optimizing-collisions-and-picking) (I’m not sure if this applies only to submeshes in a single mesh or to the entire scene? @sebavan do you know? ), and while that is not built in (yet), GPU picking is another good strategy: [GPU picking demo - Demos and projects - Babylon.js (babylonjs.com)](https://forum.babylonjs.com/t/gpu-picking-demo/30507)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [December 22, 2022, 11:38am UTC](https://forum.babylonjs.com/t/accelerating-structures-for-raycasting-against-mesh-objects/36752/3 "2022-12-22T11:38:34Z")

</div>

> [@carolhmj](#):
>
> while that is not built in (yet)

Should I understand that this is on the list or in the pipeline? Thx and have a great day 🕶

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 22, 2022, 12:06pm UTC](https://forum.babylonjs.com/t/accelerating-structures-for-raycasting-against-mesh-objects/36752/4 "2022-12-22T12:06:24Z")

</div>

Oh, not on any immediate list, but if you have interest could you create a feature request so we can discuss? 😛 Or maybe someone on the community is interested in implementing 😅
