Hi there, on a high level, I’m trying to crop objects - I initially tried doing this with CSG, however the objects I’m loading are very complex so crash the browser, or produce artefacts due to some weird geometry. Unfortunately I won’t control the input models, so I can’t fix my models ahead of time.
So I’ve been trying to come up with a way of doing it with stencil buffers instead, but I’m not getting very far. Here’s a link to a playground i’ve been working on https://www.babylonjs-playground.com/#M3RNVC#3
The general idea is that I want to cut a segment out of the sphere using the cube (and dispose of the rest), however I also want it to obey the existing depth information from the ground map on renderGrouping=0.
So far I’ve managed to get it to cut the segment out, but that’s actually the bit I want to keep! I’ve also managed to retain the segment, but it doesn’t obey the depth information.
Does anyone have any ideas or can suggest a new direction for me to try?