Can I retrieve information from ray casting?

I’m currently working on a project and I was wondering if it is possible to use ray casting on objects and retrieve information (e.g. color, opacity) of the point it hits on the surface.

Hi @AbdulrehmanSuliman

Check out the relevant docs page Mesh Picking | Babylon.js Documentation

And also PickingInfo | Babylon.js Documentation

Then this forum post for something more specific Get Texture color value at ray collision point


Hi @AbdulrehmanSuliman

The solution for the issue I opened was ok and working. But thinks about how often will you use it cause it’s performance expensive.


1 Like

And if there is more than one object stacked behind each other can I penetrate and get the information of the objects or surfaces behind?

Mesh Picking | Babylon.js Documentation (