12 lines
264 B
Plaintext
12 lines
264 B
Plaintext
// mask_shader.gdshader
|
|
shader_type canvas_item;
|
|
|
|
uniform sampler2D mask_texture;
|
|
|
|
void fragment() {
|
|
vec4 sprite_color = texture(TEXTURE, UV);
|
|
vec4 mask_color = texture(mask_texture, SCREEN_UV);
|
|
|
|
COLOR = sprite_color;
|
|
COLOR.a *= mask_color.r;
|
|
} |