Tint Blend

Tint a canvas_item and set how strong the tint is, useful for softer hit effects or to make it looks like something fades into darkness or fog.

Shader code
shader_type canvas_item;

uniform vec3 tint_color : source_color = vec3(1.0, 0.0, 0.0);
uniform float intensity : hint_range(0, 1) = 1.0;

void fragment(){
    vec4 front = texture(TEXTURE, UV);
    COLOR = mix(front, vec4(tint_color, front.a), intensity);
}
Tags
canvas item, Fog, hit, tint
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.

Related shaders

2D Canvas Group Tint

Double texture blend 2D

Clip Studio Gradient Map [ with blend mode ]

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Dareoni
Dareoni
3 months ago

thanks!