Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. shader_type canvas_item;
  2.  
  3. uniform float amplitude : hint_range(0.0, 1.0);
  4. uniform float rate : hint_range(0.0, 2000.0);
  5.  
  6. void fragment(){
  7.  
  8. float offset_dir = step(sin(UV.y * rate), 0.2) * 2.0;
  9. float offset_dir2 = step(sin(UV.x * rate), 0.2) * 2.0;
  10. float offset_curve1 = step(sin(UV.y * rate), 0.05) * 2.0;
  11. //WAVES
  12. float final_offset = ((offset_dir - 1.0) * (amplitude/2.0));
  13. float final_offset2 = ((offset_dir2 - 1.0) * (amplitude/2.0));
  14. float final_curve1 = (sin(UV.y * rate)) * (amplitude/1.0);
  15. float final_curve2 = (sin(UV.x * rate)) * (amplitude/1.0);
  16.  
  17. vec4 texture_color = texture(TEXTURE, vec2(UV.x + final_offset, UV.y + final_offset2 + final_curve2));
  18. vec4 color = texture_color;
  19. COLOR = color;
  20.  
  21. //ALPHA
  22. COLOR.a = clamp(color.a - (amplitude/1.0), 0.0, 1.0);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement