I have a basic mask shader that I use to mask part of my sprite.
I wanted to make the texture repeating to make a larger sprite, but the mask is applied to all the repeated instances of the textures, instead of the global sprite.
shader_type canvas_item;
uniform sampler2D mask_texture;
void fragment() {
vec4 colour = texture(TEXTURE, UV);
vec4 mask = texture(mask_texture, UV);
colour.a = mask.r + mask.g + mask.b;
COLOR = colour;
}
How to apply shader to region_rect instead of texture ?

EDIT: I tried using light2d in mask mode, but the black part of the mask is not transparent as when using shader alpha.