Chromakey for Godot 4.3

chromakey shader for filling the sprite.

Aplicar a la textura que debe tener Chromakey.

Shader code
shader_type canvas_item;

uniform vec4 backgroundColor : source_color = vec4(0.0, 1.0, 0.0, 1.0);

void fragment() {
    vec4 texColor = texture(TEXTURE, UV);

    if (texColor.a == 0.0) {
        COLOR = backgroundColor;
    } else {
        COLOR = texColor;
    }
}
Live Preview
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from BananaBoy

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments