Pixel Art Wind Sway (MeshInstance3D, Godot 4.0)

Simple shader that creates wind-like movement.

Works with MeshInstance3D node.

Assets made by:
Cainos: https://cainos.itch.io/pixel-art-top-down-basic 

and 

Aamatniekss: https://aamatniekss.itch.io/fantasy-knight-free-pixelart-animated-character

Shader code
shader_type spatial;
render_mode cull_disabled, depth_draw_opaque;

uniform sampler2D grass_texture : filter_nearest, source_color;

void vertex(){
	NORMAL = vec3(0.0, 1.0, 0.0);
	VERTEX.x += sin(NODE_POSITION_WORLD.x + TIME * 1.25 + UV.y) * ( 1.0 - UV.y) * 0.2;
	VERTEX.z += cos(NODE_POSITION_WORLD.z + TIME * 0.45 + UV.y) * ( 1.0 - UV.y) * 0.15;
}

void fragment(){
	ALBEDO = texture(grass_texture, UV).rgb;
	ALPHA = texture(grass_texture, UV).a;
}
Tags
animation, grass, movement, wind
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 Darfine

Billboard Sprite3D Sway (Godot 4.0)

Related shaders

2D wind sway

Billboard Sprite3D Sway (Godot 4.0)

Wind Waker Water – NO Textures needed!

guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
srbisonte
srbisonte
27 days ago

Looks really good , thanks!!