aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/Mandel.frag.glsl
diff options
context:
space:
mode:
authorJonathan Duran2012-07-17 09:30:22 -0700
committerJonathan Duran2012-07-17 09:30:22 -0700
commit53051672a62208fbc96957719d8285fac6431ed6 (patch)
tree79d542ee811044e8af2ef84aa0d6662c6eb895c4 /assets/shaders/Mandel.frag.glsl
parent7e2c2dbd040ed79a3f0678f91bd4b6db9cf69231 (diff)
parent5146f224258929415adf4a8022e492454b4e2476 (diff)
downloadninja-53051672a62208fbc96957719d8285fac6431ed6.tar.gz
Merge branch 'refs/heads/NINJA-master' into TimelineUber
Conflicts: js/panels/Timeline/DragDrop.js js/panels/Timeline/Keyframe.reel/Keyframe.js js/panels/Timeline/Layer.reel/Layer.js js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js js/panels/Timeline/Span.reel/Span.js js/panels/Timeline/Style.reel/Style.js js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js js/panels/Timeline/Track.reel/Track.html js/panels/Timeline/Track.reel/Track.js js/panels/Timeline/Track.reel/css/Track.css js/panels/Timeline/TrackSpacer.reel/TrackSpacer.html js/panels/Timeline/TrackSpacer.reel/TrackSpacer.js js/panels/Timeline/TrackSpacer.reel/css/TrackSpacer.css js/panels/Timeline/Tween.reel/Tween.js Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'assets/shaders/Mandel.frag.glsl')
-rw-r--r--assets/shaders/Mandel.frag.glsl58
1 files changed, 0 insertions, 58 deletions
diff --git a/assets/shaders/Mandel.frag.glsl b/assets/shaders/Mandel.frag.glsl
deleted file mode 100644
index 62be76b9..00000000
--- a/assets/shaders/Mandel.frag.glsl
+++ /dev/null
@@ -1,58 +0,0 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4
5uniform vec2 u_resolution;
6uniform float u_time;
7uniform float u_speed;
8
9void main(void)
10{
11 vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / u_resolution.xy;
12 p.x *= u_resolution.x/u_resolution.y;
13
14 float time = u_time * u_speed;
15
16 float zoo = .62+.38*sin(.1*time);
17 float coa = cos( 0.1*(1.0-zoo)*time );
18 float sia = sin( 0.1*(1.0-zoo)*time );
19 zoo = pow( zoo,8.0);
20 vec2 xy = vec2( p.x*coa-p.y*sia, p.x*sia+p.y*coa);
21 vec2 cc = vec2(-.745,.186) + xy*zoo;
22
23 vec2 z = vec2(0.0);
24 vec2 z2 = z*z;
25 float m2;
26 float co = 0.0;
27
28
29 // chrome/angelproject/nvidia/glslES don't seem to like to "break" a loop...
30 // so we have to rewrite it in another way
31/*
32 for( int i=0; i<256; i++ )
33 {
34 z = cc + vec2( z.x*z.x - z.y*z.y, 2.0*z.x*z.y );
35 m2 = dot(z,z);
36 if( m2>1024.0 ) break;
37 co += 1.0;
38 }
39*/
40
41 for( int i=0; i<256; i++ )
42 {
43 if( m2<1024.0 )
44 {
45 z = cc + vec2( z.x*z.x - z.y*z.y, 2.0*z.x*z.y );
46 m2 = dot(z,z);
47 co += 1.0;
48 }
49 }
50
51 co = co + 1.0 - log2(.5*log2(m2));
52
53 co = sqrt(co/256.0);
54 gl_FragColor = vec4( .5+.5*cos(6.2831*co+0.0),
55 .5+.5*cos(6.2831*co+0.4),
56 .5+.5*cos(6.2831*co+0.7),
57 1.0 );
58} \ No newline at end of file