2D Canvas Group Tint
I have been converting most objects to have canvas groups but this caused issues with my shaders. I couldn’t find it anywhere easily so made it myself. has a toggle & tint color.
Shader code
shader_type canvas_item;
render_mode unshaded;
uniform bool tint_active = false;
uniform vec4 tint_color : source_color = vec4(1.0);
uniform sampler2D screen_texture : hint_screen_texture, filter_nearest;
void fragment() {
if (tint_active == true)
{
COLOR.rgb = tint_color.rgb;
COLOR.a = texture(screen_texture, SCREEN_UV).a;
}
else
{
COLOR = texture(screen_texture, SCREEN_UV);
}
}
Hello there! Thank you very much for this Shader. Sadly, I can’t use it because it won’t work with z-Indexed Nodes, meaning Sprite2Ds for example, which have a z-Index other than “0”. My game demands the use of z-Indexes. Could you provide any solution to this? 🙂