Skip to content

Instantly share code, notes, and snippets.

@mistificator
Created August 14, 2019 20:26
Show Gist options
  • Save mistificator/4fcc5c7dbe4d5d9a8b06c521618ac6a7 to your computer and use it in GitHub Desktop.
Save mistificator/4fcc5c7dbe4d5d9a8b06c521618ac6a7 to your computer and use it in GitHub Desktop.
// from https://godotengine.org/qa/15718/how-to-change-a-specific-color-using-shaders
shader_type canvas_item;
void fragment()
{
vec4 curr_color = texture(TEXTURE, UV); // Get current color of pixel
if (curr_color == vec4(0, 0, 0, 1))
{
COLOR = vec4(0, 0, 0, 0);
}
else
{
COLOR = curr_color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment