Wavy & Colorable Text Shader

A simple canvas_item shader for Godot that applies an animated “warble” or “wavy” effect to text. This shader displaces vertices using a sine wave based on time, creating a continuous wiggling motion. It includes exposed uniform parameters to easily change the text color, as well as the speed and amplitude of the wave. I used Version 4.5 of Godot.

 

Shader code
// Text Warble GDShader Script By Matt Pin

shader_type canvas_item;

uniform vec4 text_color : source_color = vec4(1.0, 1.0, 1.0, 1.0);

uniform float warp_frequency : hint_range(0.0, 50.0) = 10.0;
uniform float warp_amplitude : hint_range(0.0, 50.0) = 5.0;
uniform float warp_speed : hint_range(0.0, 10.0) = 2.0;

void vertex() {
	VERTEX.y += sin(UV.x * warp_frequency + TIME * warp_speed) * warp_amplitude;
}

void fragment() {
	float original_alpha = texture(TEXTURE, UV).a;
	
	COLOR = vec4(text_color.rgb, original_alpha * text_color.a);
}
Tags
text, wavy
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 MattPin

PSX/CRT Retro Shader for Godot

Related shaders

Slide Down & Up Text Effect

2D Flame, Leaves, Wavy Sway / Gentle Horizontal Flicker Shader

Wavy Texture

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments