To compute a Heightfield from a mesh, I’d use this : Babylon.js docs
and use float values. Then write texel as mesh height (with appropriate camera placement) and read back texels using .
There are threads on this forum doing the same : How to access depth of RenderTargetTexture?
This said, for physics, I’d try first use physics mesh shape for static colliders.