Skip to content

Instantly share code, notes, and snippets.

@henriiquecampos
Created October 27, 2020 13:36
Show Gist options
  • Save henriiquecampos/bfc5ba6f22378da993d346cd6a09a8bd to your computer and use it in GitHub Desktop.
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
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