And I found one more. The solution is put cylinder to 0 index of scene.meshes array and disable color writing for this cylinder
var mask_index = scene.meshes.indexOf(cylinder);
scene.meshes[mask_index] = scene.meshes[0];
scene.meshes[0] = cylinder;cylinder.registerBeforeRender(function () {
engine.setColorWrite(false);
});
cylinder.registerAfterRender(function () {
engine.setColorWrite(true);
});
From this tutorial for Unity I found out about depth masks and search abut it in Babylon. Solution was founded here