Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float triDist(vec2 p){
- float f = smoothstep(0.0,0.01,p.x-p.y);
- f*= smoothstep(0.0,0.01,-p.x-p.y);
- f*= smoothstep(0.0,0.01,0.5+p.y);
- return f;
- }
- void main(){
- vec2 p = gl_FragCoord.xy/iResolution;
- p-=0.5;
- p.x *= iResolution.x/iResolution.y;
- p*=20.0;
- float gridsize = 1.5;
- vec2 pcenter = floor((p)/gridsize);
- float angle = 1.0+iGlobalTime+sin(1.0*pcenter.x);
- angle = angle;
- vec2 prot=mod(p,gridsize)-gridsize/2.0;
- prot = mat2(
- cos(angle),
- sin(angle),
- -sin(angle),
- cos(angle)
- )*prot;
- vec2 ptrans = prot-vec2(0.0,0.0);
- float f = triDist(ptrans);
- ptrans = mat2(
- cos(3.14159/1.0),
- sin(3.14159/1.0),
- -sin(3.14159/1.0),
- cos(3.14159/1.0)
- )*prot;
- ptrans = ptrans-vec2(0.0,-0.0);
- f = max(f,triDist(ptrans));
- float m = 0.5+0.5*sin(123.0*pcenter.x+5587.0*pcenter.y+3.0*iGlobalTime);
- gl_FragColor = vec4(m*f,0.0,0.0,1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment