Advertisement
Guest User

Godot Simple Wind Vertex Shader

a guest
Dec 17th, 2022
5,517
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | Source Code | 1 0
  1. group_uniforms wind;
  2. uniform sampler2D noise_tex;
  3. uniform float wind_speed = .1;
  4. uniform float wind_strength = .01;
  5.  
  6. vec3 GLOBAL_VERTEX = (MODEL_MATRIX * vec4(VERTEX, 1.)).xyz;
  7.  
  8. float offset = TIME * wind_speed;
  9. float noise = texture(noise_tex, vec2(GLOBAL_VERTEX.x-offset)).r;
  10. noise -= .5;
  11. noise *= wind_strength;
  12. VERTEX.xy += noise * length(VERTEX.y) * length(VERTEX.xz);
Tags: Godot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement