Mesh picking with large camera.maxZ

I’ve noticed that setting my camera maxZ value to some very large number (eg. 1e10) causes mesh picking to stop working. Here is an example in the playground, you’ll notice that the picking doesn’t work due to the high maxZ, however if you change the camera.maxZ to 1e5 the picking works again.

Is it possible to use a large camera.maxZ whilst retaining picking functionality?

This is unfortunately all about 32bits float precision.
You can try this: BABYLON.Matrix.Use64Bits = true

You need to run it before everything else

Ahh I didn’t realise there’s an option to enable 64 bit precision, thanks for pointing that out!

1 Like