diff options
author | Eric Guzman | 2012-02-27 11:13:35 -0800 |
---|---|---|
committer | Eric Guzman | 2012-02-27 11:13:35 -0800 |
commit | 1a6604a50f6cfbbf0cd6f45ab94b63a001d02162 (patch) | |
tree | bbfc75d1be1ff98d22042dbbed4ca93b4a845e0c /assets/shaders/Julia.frag.glsl | |
parent | 9e8cd4448a6d0f809a55c3bdea8b45ed75339794 (diff) | |
parent | 8125c8c6c9431067840d81c46624b6a2dd5eb4a7 (diff) | |
download | ninja-1a6604a50f6cfbbf0cd6f45ab94b63a001d02162.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
Diffstat (limited to 'assets/shaders/Julia.frag.glsl')
-rw-r--r-- | assets/shaders/Julia.frag.glsl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/assets/shaders/Julia.frag.glsl b/assets/shaders/Julia.frag.glsl new file mode 100644 index 00000000..68cda703 --- /dev/null +++ b/assets/shaders/Julia.frag.glsl | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifdef GL_ES | ||
2 | precision highp float; | ||
3 | #endif | ||
4 | |||
5 | uniform vec2 u_resolution; | ||
6 | uniform float u_time; | ||
7 | |||
8 | void main(void) | ||
9 | { | ||
10 | vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy; | ||
11 | vec2 cc = vec2( cos(.25*u_time), sin(.25*u_time*1.423) ); | ||
12 | |||
13 | float dmin = 1000.0; | ||
14 | vec2 z = p*vec2(1.33,1.0); | ||
15 | for( int i=0; i<64; i++ ) | ||
16 | { | ||
17 | z = cc + vec2( z.x*z.x - z.y*z.y, 2.0*z.x*z.y ); | ||
18 | float m2 = dot(z,z); | ||
19 | if( m2>100.0 ) break; | ||
20 | dmin=min(dmin,m2); | ||
21 | } | ||
22 | |||
23 | float color = sqrt(sqrt(dmin))*0.7; | ||
24 | gl_FragColor = vec4(color,color,color,1.0); | ||
25 | } \ No newline at end of file | ||