hp_warpdripple.fp 591 B

1234567891011121314151617181920
  1. /*
  2. * HPack: "Dripple Warp" shader, for H4M8's end sky
  3. *
  4. * Basically a quick edit of GZDoom's default warp shader,
  5. * but a bit less intense and with a clamp on the upper
  6. * part of the texture so it doesn't leak the sky up top.
  7. */
  8. uniform float timer;
  9. vec4 Process(vec4 color)
  10. {
  11. vec2 texCoord = gl_TexCoord[0].st;
  12. const float pi = 3.14159265358979323846;
  13. vec2 offset = vec2(0,0);
  14. offset.y = max(sin(pi * 2.0 * (texCoord.x + timer * 0.125)) * 0.05, 0.0);
  15. offset.x = sin(pi * 2.0 * (texCoord.y + timer * 0.125)) * 0.05;
  16. texCoord += offset;
  17. return getTexel(texCoord) * color;
  18. }