Need help in cap setting for the imported meshes


I am new to babylon js, I saw the following example on clip planes, how do I set the CAP_ALL on the mesh as soon as it is clipped?

Could you please help me in this?


It is unfortunately not possible, clipping is purely a gpu functionnality to prevent rendering some of the pixels, it can not create new geometries.

Thanks for the confirmation, is there any other alternative to achieve the same result without using clipping?

You might try to rely on CSG to construct meshes dynamically but as it is a slow process I would advise to not do it every frame.

Thanks for the suggestion sebavan :slight_smile:

Here my code is shitty, but you may try to duplicate your mesh and apply an unlighted material to fake an uniform cutted surface :
(l. 19 to 27)
It’s not a perfect solution as it could generate some visual artefacts, depending of the mesh complexity.

(on my example I wanted to flip the duplicated mesh normals, instead of using backface + zOffset, but don’t know how to do)


Interesting approach, thanks a lot for the suggestion, I will try this.