Low life flash 2D

Flash for Sprite node or Animated Sprite

A flash that can be used to hit the player or to announce that he is low on health can also be used on a large boss to announce that he is about to die.

It’s my second shader I’m learning little by little

I hope to improve it a bit later

Greetings to all!

Shader code
//Shader BY LURGX second shader */
//

shader_type canvas_item;
uniform bool shine: true;
uniform bool move: true;
uniform float side = 0.9;
uniform float up = 0.1;
uniform vec4 color: hint_color;
uniform float u_time: hint_range (0.,10.);


void vertex() {//Movement 
if (move == true){
	VERTEX += vec2(cos(TIME*u_time)*side,cos(TIME*u_time)*up);
}
}

void fragment() { //COLOR SHINE
if (shine == true){
	COLOR = texture(TEXTURE, UV);
	COLOR.rgb += vec3(color.r,color.g,color.b)*(abs(cos(TIME*u_time)));
}
}
Tags
#Flash #Outline #2d
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 lurgx

2D Outline and Rainbow outline 2 in 1

Related shaders

Hit Flash Effect Shader

Circular Life Bar

Hit flash effect

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
rsvd
rsvd
9 months ago

looks to me like smt is blowing up =)