Shader 代码部分

1
2
3
4
5
6
7
8
shader_type canvas_item;

uniform float threshold : hint_range(0,1)=0.5;

void fragment() {
    float g = dot(texture(TEXTURE, UV).rgb, vec3(0.299,0.587,0.114));
    COLOR = vec4(vec3(step(threshold, g)), 1.0);
}

编辑器调整

封面

原型参考

封面