Masking of objects

Hi Guys,

Please suggest how can i achieve the same masking effect in BabylonJS -
three.js examples

Thanks in advance!

@Evgeni_Popov want to give this one a try ?

I would do it with a custom shader, but other solutions are probably possible:

Same thing using a node material instead: