Created
October 27, 2020 13:36
-
-
Save henriiquecampos/bfc5ba6f22378da993d346cd6a09a8bd to your computer and use it in GitHub Desktop.
A Godot Engine shader that turns pixel into white once its uniform is set to true
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
uniform bool damaged = false; | |
void fragment(){ | |
vec4 previous_color = texture(TEXTURE, UV); | |
vec4 white_color = vec4(1.0, 1.0, 1.0, previous_color.a); | |
vec4 new_color = previous_color; | |
if (damaged == true){ | |
new_color = white_color; | |
} | |
COLOR = new_color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment