adding scanned images and other examples

pull/18/head^2
Patricio Gonzalez Vivo 9 years ago
parent 675cc3b9f5
commit cf7ff5655b

@ -0,0 +1,35 @@
// Author @patriciogv - 2015
// http://patriciogonzalezvivo.com
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
mat2 rotate2d(float angle){
return mat2(cos(angle),-sin(angle),
sin(angle),cos(angle));
}
float stripes(vec2 st, float angle){
st = rotate2d(angle) * st*10.;
return 1.0-abs(sin(st.x*3.1415));
}
void main() {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
vec3 color = vec3(.0);
vec2 pos = vec2(0.5)-st;
float t = u_time*.5;
float r = dot(pos,pos)*4.;
st *= 2.;
float pattern = sin(fract(r+t)*3.1415);
pattern = mix(stripes(st,-0.786375),stripes(st,0.786375),pattern);
gl_FragColor = vec4( vec3(smoothstep(.4,.5,pattern)), 1.0 );
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

@ -66,21 +66,9 @@ float snoise(vec2 v) {
return 130.0 * dot(m, g);
}
float cascade(vec2 st, float time) {
vec2 pos = st*vec2(30.,2.*st.y*st.y)+vec2(0.,time);
float n = (.5+snoise(pos)*.5)*(st.y-.2);
return smoothstep(.4,.6,n);
}
float circe(vec2 st, float radius) {
st = vec2(0.5)-st;
float r = length(st)*2.0;
float a = atan(st.y,st.x);
return 1.-smoothstep(radius,radius+0.007,r);
}
float ring(vec2 st, float radius, float width) {
return circe(st,radius)-circe(st,radius-width);
float cascade(vec2 st, vec2 zoom, float time, float warp) {
vec2 pos = st*zoom*vec2(1.,pow(st.y,warp))+vec2(0.,time);
return (.5+snoise(pos)*.5)*(st.y);
}
void main() {
@ -89,9 +77,13 @@ void main() {
vec2 pos = st-vec2(.5);
float r = dot(pos,pos);
float a = atan(pos.y,pos.x);
color += ring(st,0.65,.01);
color *= 1.5;
color += cascade(vec2(a,r*10.),u_time*2.) * smoothstep(.11,.1,r);
st = vec2(a,r*8.);
color = vec3(1.)*smoothstep(.5,.8, cascade(st,vec2(30.,3.),u_time*3.,5.));
color += vec3(.5)*smoothstep(.6,.7, cascade(st,vec2(50.,5.),u_time*2.,1.));
color += smoothstep(.03,.20,r)*.5;
color *= 1.0-smoothstep(.11,.13,r);
gl_FragColor = vec4(color,1.0);
}

@ -11,8 +11,8 @@ uniform float u_time;
float random (in vec2 st) {
return fract(sin(dot(st.xy,
vec2(12.9898,78.233)))*
43758.5453123);
vec2(12.9898,78.233)))
* 43758.5453123);
}
// Based on Morgan McGuire @morgan3d
@ -44,30 +44,23 @@ float lines(in vec2 pos, float angle, float b){
pos *= scale;
pos = rotate2d( angle ) * pos;
return smoothstep(0.0,
0.5+b*0.5,
abs((sin(pos.x*3.1415)+b*2.0))*0.5);
.5+b*.5,
abs((sin(pos.x*3.1415)+b*2.0))*.5);
}
void main() {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
vec3 color = vec3(0.0);
st.y *= u_resolution.y/u_resolution.x;
vec2 pos = vec2(st*5.0);
vec2 pos = st.yx*vec2(10.,3.);
float pattern = pos.x;
// Stripes
// pattern = lines(pos*0.1, 0.0, 0.5 );
pattern = lines(pos, 0.0, 0.5 );
// Add noise
// pattern = lines(pos, noise(pos), 0.5 );
pattern = lines(pos, noise(pos), .5 );
// Strech the noise pattern
//pattern = lines(pos, noise(pos*vec2(2.,0.5)),0.5);
color = mix(vec3(0.275,0.145,0.059),
vec3(0.761,0.529,0.239),
pattern*1.7);
gl_FragColor = vec4(color,1.0);
gl_FragColor = vec4(vec3(pattern),1.0);
}
Loading…
Cancel
Save