3D Wobbly Effect

Based highly on RoughSkin’s shader, but modified for spatial objects. Use a clouds texture for the displacement for the best results.

(for some reason I cannot delete the accidental duplicate of this shader I made, oof…)

Shader code
shader_type spatial;
uniform vec4 albedo : hint_color;
uniform sampler2D albedo_texture : hint_albedo;
uniform vec3 uv1_scale;
uniform vec3 uv1_offset;

uniform float brightness = 1.0;
uniform vec2 disp_scale = vec2(1.0,1.0); //Displacement map scale
uniform sampler2D flowMap; //Displacement map
uniform float strength = 1; //Force of the effect
uniform float speed = 1; //Speed of the effect

void vertex() {
	UV=UV*uv1_scale.xy+uv1_offset.xy;
}

void fragment() {
	float c = TIME * speed;
	vec4 offset = texture(flowMap, disp_scale.xy * vec2(UV.x + c, UV.y + c)) * strength;
	//ALPHA = albedo.a * texture(albedo_texture, (vec2(UV.x + offset.x, UV.y + offset.y) - vec2(0.5,0.5))).a;
	ALBEDO = brightness * albedo.rgb * texture(albedo_texture, (vec2(UV.x + offset.x, UV.y + offset.y) - vec2(0.5,0.5))).rgb;
}
Tags
sketch, wobble, wobbly
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

Glass Square Effect Shader

Shaped Glow Post-Processing Effect

X-ray Vision Effect

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Average Godot Enjoyer
4 months ago

If you want to use this in Godot 4.0 up you have to replace the lines

uniform vec4 albedo : hint_color;
uniform sampler2D albedo_texture : hint_albedo;

with this

uniform vec4 albedo : source_color;
uniform sampler2D albedo_texture : source_color;

Great shader.