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;

	}

}
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

Dashed Grid (The Best Darn Grid Shader (Yet))

3D Grid (with individual cell control)

Simple World Triplanar Grid (Allows Transparency)

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments