Skip to content

Instantly share code, notes, and snippets.

Created January 8, 2021 12:45
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Color replacement shader for Godot Engine
* Replace a color by another one.
* License: CC0
shader_type canvas_item;
uniform vec4 remove_color: hint_color;
uniform vec4 replace_color: hint_color;
void fragment(){
vec4 col = texture(TEXTURE, UV);
if (col.rgb == remove_color.rgb){
col = replace_color;
COLOR = col;
Copy link

deakcor commented Jan 8, 2021

Example with green color replaced by transparent one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment