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);
	}
	
}
Live Preview
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

Related shaders

guest

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

MG2 MSX Nice!