shader_type canvas_item; uniform float threshold : hint_range(0.0, 1.0) = 0.01; void fragment() { vec4 tex_color = texture(TEXTURE, UV); float brightness = max(tex_color.r, max(tex_color.g, tex_color.b)); if (brightness < threshold) { discard; } COLOR = tex_color; }