Debian Codegraph @

screensaver.shadertoy/resources/shaders/fractaltiling.frag.glsl

raw
1 // from: https://www.shadertoy.com/view/Ml2GWy
2
3 // Created by inigo quilez - iq/2015
4 // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
5
6
7 void mainImage( out vec4 fragColor, in vec2 fragCoord )
8 {
9 vec2 pos = 256.0*fragCoord.xy/iResolution.x + iGlobalTime;
10
11 vec3 col = vec3(0.0);
12 for( int i=0; i<6; i++ )
13 {
14 vec2 a = floor(pos);
15 vec2 b = fract(pos);
16
17 vec4 w = fract((sin(a.x*7.0+31.0*a.y + 0.01*iGlobalTime)+vec4(0.035,0.01,0.0,0.7))*13.545317); // randoms
18
19 col += w.xyz * // color
20 smoothstep(0.45,0.55,w.w) * // intensity
21 sqrt( 16.0*b.x*b.y*(1.0-b.x)*(1.0-b.y) ); // pattern
22
23 pos /= 2.0; // lacunarity
24 col /= 2.0; // attenuate high frequencies
25 }
26
27 col = pow( 2.5*col, vec3(1.0,1.0,0.7) ); // contrast and color shape
28
29 fragColor = vec4( col, 1.0 );
30 }