The UIMask draws something and writes into depth - it does it at a forced time in the render pipeline, so it draws before the things that are meant to be clipped. You can replace it with any shape you like - its just a quad, but will work if you change the shape. Just keep in mind the z coordinate, thats what it uses to sort.