godot4 wobby grid
A spatial godot shader creating wobby grid effect.
NOTICE: time is generated from cpu.
Shader code
shader_type spatial;
render_mode unshaded;
uniform vec3 color : source_color;
uniform vec2 size;
uniform float width_rate;
uniform sampler2D noise_texture : filter_linear;
uniform float noise_strength : hint_range(0.0, 0.1, 0.01);
uniform vec2 noise_offset_velocity;
uniform float time;
void fragment() {
vec2 uv_noise = UV + (texture(noise_texture, UV + noise_offset_velocity * time).rg - vec2(0.5)) * noise_strength;
vec2 uv_grid = mod(uv_noise * size, vec2(1.0, 1.0));
if(min(uv_grid.x, uv_grid.y) < width_rate) {
ALBEDO = color;
} else {
discard;
}
}