I am developing an AR application using Babylon.js. I need to hide a virtual object behind a real object using a transparent mesh, like is described on this question regarding Three.js: three.js transparent object occlusion
Is it possible to do something like this with Babylon.js, I haven't been able to figure it out?
Sure, you can use a mesh to occlude parts of another mesh, you only have to turn off and turn on the mesh (occluder) before and after rendering.
occluderMesh.onBeforeRenderObservable.add(() => engine.setColorWrite(false));
occluderMesh.onAfterRenderObservable.add(() => engine.setColorWrite(true));
Check this example: https://playground.babylonjs.com/#AAM6LK