Files
MaidEngine/shaders/chroma_key.gdshader
2026-04-01 17:16:58 -04:00

13 lines
276 B
Plaintext

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;
}