Created
August 14, 2019 20:26
-
-
Save mistificator/4fcc5c7dbe4d5d9a8b06c521618ac6a7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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