Swapped sprites
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform vec4 key_color : source_color = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
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) {
|
||||
float dist = distance(tex_color.rgb, key_color.rgb);
|
||||
if (dist < threshold) {
|
||||
discard;
|
||||
}
|
||||
COLOR = tex_color * COLOR;
|
||||
|
||||
Reference in New Issue
Block a user