Initial commit
This commit is contained in:
12
shaders/chroma_key.gdshader
Normal file
12
shaders/chroma_key.gdshader
Normal file
@@ -0,0 +1,12 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user