i want to make a hole in scene that can be through engine use setColorWrite,
mesh.onBeforeRenderObservable.add(() => engine.setColorWrite(false))
mesh.onAfterRenderObservable.add(() => engine.setColorWrite(true))
but if mesh in scene.meshs it can work with everymeshs, else if is just can influence meshs after it in scene.meshs
there is an example
how can i fix it or is there better way to make a hole?
i try to change hole mesh to first, in low version (like 4.2) is ok ,but in latest version like 5.38 is not work
I found this example with stencils: Babylon.js Playground (babylonjs.com)
Depending on your needs, you could also use CSG: Merging Meshes | Babylon.js Documentation (babylonjs.com), and @Evgeni_Popov also knows all kinds of cool tricks
Meshes are now sorted by material to improve performances and not rendered in the order they were created anymore.
You can make sure that
sphere3 is rendered first by setting
renderingGroupId = 1 for all other meshes:
Or you can provide your own sorting function for opaque objects through
thanks for ur help bigman
@Evgeni_Popov is my favourite bigman