Randoloot/resources/effects/tree_wind.gdshader
2026-10-18 19:26:02 +02:00

9 lines
322 B
Plaintext

shader_type canvas_item;
uniform vec2 wind_direction = vec2(0.95,0.3);
uniform float wind_strength = 0.6;
void vertex() {
vec2 point = (MODEL_MATRIX*vec4(VERTEX,0.0,1.0)).xy;
float sway = sin(TIME*1.35+point.x*0.012+point.y*0.006)*0.7+sin(TIME*2.1+point.y*0.014)*0.3;
VERTEX += wind_direction*sway*wind_strength*1.5;
}