Flash Shader

This shader creates a flashing effect on textures and sprites. It allows your objects to briefly brighten or change color, useful for simulating damage feedback, power-ups, or other visual cues.

Shader code
shader_type canvas_item;

uniform bool active;
uniform vec3 flash_color : source_color = vec3(1.0);


void fragment(){
	vec4 t = texture(TEXTURE, UV);
	if (active == true) {
		COLOR = vec4(flash_color, t.a);
	}
	
}
Tags
#flash #shader
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 Pointblanks

Blood Shader

Related shaders

Hit Flash Effect Shader

Low life flash 2D

Hit flash effect

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
beebster
6 months ago

MG2 MSX Nice!