Squigglevision

Per-object Squigglevision, also known as shimmer or boiling lines. Helps emulate a hand drawn, frame-by-frame look.

Noise should be a seamless grayscale texture. The shader uses world space coordinates for consistency across objects.

Shader code
shader_type canvas_item;
render_mode world_vertex_coords;

group_uniforms Squiggle;
/**
 * Noise texture scale
 * By default, the noise texture's size in world coordinates is set by its resolution
*/
uniform vec2 scale = vec2(1.0);
uniform float strength = 1.0;
/**
 * Number of squiggle frames per second
*/
uniform float fps = 6.0;
uniform sampler2D noise : filter_linear, repeat_enable;
group_uniforms;

varying vec4 modulate;
varying vec2 noise_uv;

void vertex() {
	modulate = COLOR;
	
	// Use world coordinates for scale-independent squiggles, offset by position to keep pattern attached to object
	noise_uv = (VERTEX - MODEL_MATRIX[3].xy) / (vec2(textureSize(noise, 0)) * scale);
}

// Use irrational constants for unique squiggles every frame
#define offset_multiplier vec2(PI, E)

void fragment() {
	vec2 noise_offset = vec2(floor(TIME * fps)) * offset_multiplier;
	float noise_sample = texture(noise, noise_uv + noise_offset).r * 4.0 * PI;
	vec2 direction = vec2(cos(noise_sample), sin(noise_sample));
	vec2 squiggle_uv = UV + direction * strength * 0.005;
	
	COLOR = texture(TEXTURE, squiggle_uv) * modulate;
}
Live Preview
Tags
cartoon, distortion, doodle, drawing, hand drawn, shimmer, sketch, squiggle, toon, wiggle
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 tentabrobpy

guest

7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Diogo Matheus
Diogo Matheus
3 months ago

Nice shader, can you share the original noise?

André
André
3 months ago

That’s so coooool!!!

Tsunscreen
Tsunscreen
3 months ago

I adore this shader, thank you!

gurbsgurbs
gurbsgurbs
2 months ago

Really nice!
How would you adapt this shader to use it on an entire scene?

behnder
1 month ago

amazing