How to crop the border of an image to the shape i need

Hello. I would like to make it so that the image can be cropped not only by the rectangle shape, but also by some other shape. Is it possible? Is it possible on this playground to make it so that the progress bar is cropped by the background, i.e. the pbBackground image? I want the progress bar pbBar to be inside pbBackground. You can see that when the progress bar width decreases, its left edge gradually aligns with the vertical border of wrapRect

It’s possible to manipulate GUI elements with shaders. There are some useful informations in this thread : The material of a GUI element - #7 by mawa

I don’t know if there is an easier way to achieve it.

Thanks, I’ll try