When using clipPlanes, the suggested way to clip one mesh is to set scene.clipPlane
in onBeforeRenderObservable
and to clear it in onAfterRenderObservable
.
But when the mesh has a material which is not currently ready on first render, the onBeforeRenderObservable
is called but the onAfterRenderObservable
is not, causing other meshes being clipped.
Screenshot:
Playground:
Note: keep the playground page focused when loading to reproduce.