One of the problems with this implementation is that there is no depth occlusion, which may require a deep understanding of the babylonjs render pipeline;
Can the babylonjs team publish the following two articles:
Articles on the BabylonJS Render Pipeline;
How to configure babylonjs when integrating with other webgl libraries;
That at least goes through why there is autoClear and wipeCaches are doing in the example you have provided. There are some articles on default render pipeline - sounds like maybe you want a flat map to occlude a portion of the babylon.js scene?