In the description you can find links to the blog post explaining how I did everything and to the source code. The latest Godot versions have stencil buffer support so it’s now possible to do this slightly better, but I haven’t had time to experiment with this myself.