Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fragment shader
- precision highp float;
- #define PI 3.14159265359
- #define PI2 6.28318530718
- varying vec2 UV;
- varying vec3 v_position;
- uniform float time;
- uniform float ratio;
- uniform vec2 mouse;
- float func(float x){
- return 0.4 * cos(x * PI + time * PI2);
- }
- void main(void){
- float x = UV.x * ratio;
- float y = 2.0 * UV.y - 1.0;
- vec4 col = vec4(0.0);
- for(int i = 0; i < 10; i++){
- if(distance(func(x + float(i)/10.0 + float(i) * x * 0.0),y) < 0.01){
- col.rgb += 1.0;
- }
- }
- col.a = 1.0;
- gl_FragColor = col;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement