Acceleration Effect

With this shader you can achieve a silhouette effect, you can use it for your player or for anything else you want, you also have the option to modify the opacity, RGB and color mixing through code.

Shader code
shader_type canvas_item;
uniform float opacity;
uniform float r;
uniform float g;
uniform float b;
uniform float mix_color;

void vertex() {
	
}

void fragment() {
	// Se llama así por cada píxel en el que el material es visible.
	vec4 texture_color = texture(TEXTURE, UV);
	if (texture_color.a != 0.0)
		COLOR = vec4(mix(texture_color.rgb, vec3(r,g,b), mix_color), opacity);
}

void light() {
	// Se llama para cada píxel de cada luz que afecta al CanvasItem.
	float cNdotL = max(1.0, dot(NORMAL, LIGHT_DIRECTION));
	LIGHT = vec4(LIGHT_COLOR.rgb * COLOR.rgb * LIGHT_ENERGY * cNdotL, LIGHT_COLOR.a);
}
Tags
Acceleration, Dash
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

Unmoving Plaid Effect

cartoon explosion effect

2D Wavy Effect

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
GDevLearn
12 days ago

uniform float opacity: hint_range(0.0, 1.0);
uniform float r: hint_range(0.0, 1.0);
uniform float g: hint_range(0.0, 1.0);
uniform float b: hint_range(0.0, 1.0);
uniform float mix_color: hint_range(0.0, 1.0);

Add settings for ease of use

GDevLearn
12 days ago
Reply to  GDevLearn

uniform vec4 material_color: source_color;

Or better use this