Hit flash effect

Simple hit flash / color changing shader

2 parameters;

Active – Sets the flash on/off 

Tint – Set the color of the flash

 

 

 

Credits to; @triangledevv

With this one you can play around with the modulate even when the shader is inactive ( as I already almost went crazy looking for the issue)

Shader code
shader_type canvas_item;

uniform bool active = false;
uniform vec4 tint : source_color = vec4(1., 1., 0., 1);

void fragment() {
	vec4 tint_copy = tint;
	vec4 previous_color = texture(TEXTURE, UV);
	
	if (active == true)
	{
		tint_copy.a = previous_color.a;
		COLOR = tint_copy;
	}
}
Tags
flash, hit
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

Hit Flash Effect Shader

Color cycling hit effect

Flash Shader

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments