Skip to content

Commit

Permalink
modify atlas effects
Browse files Browse the repository at this point in the history
  • Loading branch information
Sian Cao committed May 8, 2014
1 parent 6af67d7 commit 487a2ed
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions atlas_frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,12 @@ varying vec2 texcoord;

#define PI 3.1415926

vec4 effects(){
vec2 p = (gl_FragCoord.xy - 0.5 * resolution.xy) / min(resolution.x, resolution.y);
vec2 t = vec2(gl_FragCoord.xy / resolution.xy);

vec3 c = vec3(0);

for(int i = 0; i < 10; i++) {
float t = 0.4 * PI * float(i) / 30.0 * time * 0.5;
float x = cos(3.0*t);
float y = sin(4.0*t);
vec2 o = 0.2 * vec2(x, y);
float r = fract(x);
float g = 0.5 - r;
c += 0.02 / (length(p-o)) * vec3(r, g, 0.9);
}

return vec4(c, 1);
vec4 effects() {
vec2 p = ( gl_FragCoord.xy / resolution.xy ) - (cos(time) + 2.0)/5.;
float sx = 0.3 * (p.x + 0.8) * sin( 5.0 * p.x - 2. * time);
float dy = 4./ ( 30. * abs(p.y - sx));
dy += 1./ (60. * length(p - vec2(p.x, 0.)));
return vec4( (p.x + 0.4) * dy, 0.3 * dy, dy, 1.0 );
}

void main()
Expand Down

0 comments on commit 487a2ed

Please sign in to comment.