Advertisement
Guest User

Shader #2

a guest
Feb 28th, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #ifdef GL_ES
  2. precision mediump float;
  3. #endif
  4.  
  5.  
  6. uniform vec2 u_resolution;
  7. uniform vec2 u_mouse;
  8. uniform float u_time;
  9.  
  10. vec3 colorA = vec3(0.,0.373,0.451);
  11. vec3 colorB = vec3(0.039,0.576,0.588);
  12.  
  13. float plot (vec2 st, float pct){
  14. return step( pct-0.234, st.x) -
  15. step( pct+0.018, st.x);
  16. }
  17.  
  18. void main() {
  19. vec2 st = gl_FragCoord.xy/u_resolution.xy;
  20. vec3 color = vec3(0.0);
  21.  
  22. vec3 pct = vec3(st.y);
  23.  
  24. //Build pattern
  25. pct.g += cos(st.x*sin(u_time/5.0)*25.0) + cos(st.y*sin(u_time/30.0)*15.0);
  26. pct.b += sin(st.x*sin(u_time/5.0)*25.0) + sin(st.y*sin(u_time/30.0)*15.0);
  27.  
  28.  
  29.  
  30. // Plot transition lines for each channel
  31. color = mix(colorA,colorB,plot(st,pct.g));
  32. color = mix(color,vec3(1.0),plot(st,pct.b));
  33.  
  34. gl_FragColor = vec4(color,1.0);
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement