trees_sway.fp 304 B

1234567891011
  1. //mxd. Simple tree textures sway shader
  2. uniform float timer;
  3. const float pi = 3.14159265358979323846;
  4. const float sway_ammount = 0.02;
  5. vec4 Process(vec4 color)
  6. {
  7. vec2 t = gl_TexCoord[0].st;
  8. t.x += sin(pi * 0.5 * (t.y + timer * 0.5)) * sway_ammount * max(0.0, 0.6 - t.y);
  9. return getTexel(t) * color;
  10. }