Godot 黑白 shader

draft / 2025-02-21 / 原文

shader_type canvas_item;

void vertex() {
	// Called for every vertex the material is visible on.
}

void fragment() {
	COLOR = texture(TEXTURE,UV);
	float a = (COLOR.r + COLOR.g + COLOR.b)/4.0;
	float b = step(0.3,a);
	COLOR.rgb = vec3(b);
	
	
	// Called for every pixel the material is visible on.
}