Advertisement
Guest User

Random GLSL thing

a guest
Apr 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #ifdef GL_ES
  2. precision mediump float;
  3. #endif
  4.  
  5. #define PROCESSING_COLOR_SHADER
  6.  
  7. uniform vec2 u_resolution;
  8. uniform vec2 u_mouse;
  9. uniform float u_time;
  10. uniform sampler2D test;
  11.  
  12.  
  13. void main() {
  14. // vec2 st = u_mouse/u_resolution;
  15. vec2 st = gl_FragCoord.xy/u_resolution;
  16. st.x=(st.x-0.5)*u_resolution.x/256.0+0.5;
  17. st.y=(st.y-0.5)*u_resolution.y/256.0;
  18. vec2 gg = vec2(1)-vec2(u_mouse.x,u_mouse.y)/256.0;
  19. // float pos=mod(( st.x+((st.x-0.5)*2.0*(atan(abs(st.y*st.y*st.y*2.0))/-3.14*1.0+1.0)) )+gg.x,1.0);
  20. float pos=mod(( st.x+((st.x-0.5)*2.0*max(1.0-(st.y*st.y),0.0)) )+gg.x,1.0);
  21. float wow=sin(pos*3.14*16.0-3.14/2.0)*0.5+0.5;
  22. vec3 col = texture2D (test, vec2(pos,mod(st.y,1.0))).xyz;
  23. gl_FragColor = vec4(vec3(pos),1.0);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement