blob: 68cda7034b5bf82fdf2ae72aa02cf195b62c6e70 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#ifdef GL_ES
precision highp float;
#endif
uniform vec2 u_resolution;
uniform float u_time;
void main(void)
{
vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy;
vec2 cc = vec2( cos(.25*u_time), sin(.25*u_time*1.423) );
float dmin = 1000.0;
vec2 z = p*vec2(1.33,1.0);
for( int i=0; i<64; i++ )
{
z = cc + vec2( z.x*z.x - z.y*z.y, 2.0*z.x*z.y );
float m2 = dot(z,z);
if( m2>100.0 ) break;
dmin=min(dmin,m2);
}
float color = sqrt(sqrt(dmin))*0.7;
gl_FragColor = vec4(color,color,color,1.0);
}
|