Babylon.js does not draw meshes in the scene.meshes
order anymore, but sort them per material instead, for speed optimization reasons.
The PG relies on the plane being drawn first to work.
There are several way to fix it:
- set
renderingGroupId
to 1 for all objects but the plane: https://playground.babylonjs.com/#1DX9UE#654 - create a material for each object, but make sure to create the material for the plane first. Because the meshes are sorted according to their material id, the plane will be the first to be drawn after sorting: https://playground.babylonjs.com/#1DX9UE#655. Note that in the PG, I updated line 136 to make sure to use my material and not the one created by the CSS renderer
- you can provide your own sorting method. See how it is done here: Guys i got some thing wrong that make a hole - #3 by Evgeni_Popov