diff --git a/2019-01-30/antoine1.glsl b/2019-01-30/antoine1.glsl new file mode 100644 index 0000000..36d122f --- /dev/null +++ b/2019-01-30/antoine1.glsl @@ -0,0 +1,142 @@ +#version 410 core + +uniform float fGlobalTime; // in seconds +uniform vec2 v2Resolution; // viewport resolution (in pixels) + +uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq +uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients +uniform sampler1D texFFTIntegrated; // this is continually increasing +uniform sampler2D cookie; +uniform sampler2D descartes; +uniform sampler2D texNoise; +uniform sampler2D texTex2; + +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything + +#define time fGlobalTime + +float sph(vec3 p, float r){ + return length(p)-r; +} + +float box(vec3 p, vec3 s) { + vec3 ap=abs(p)-s; + return length(max(vec3(0),ap)) + min(0, max(ap.x, max(ap.y,ap.z))); +} + + +float box(vec2 p, float s) { + vec2 ap=abs(p)-s; + return length(max(vec2(0),ap)) + min(0, max(ap.x, ap.y)); +} + +mat2 rot(float a) { + float ca=cos(a); + float sa=sin(a); + return mat2(ca,sa,-sa,ca); + +} + +float cyl(vec2 p, float r) { + return length(p)-r; + +} + +float smin(float a, float b, float h) { + float k=clamp((a-b)/h*0.5+0.5,0,1); + return mix(a,b,k) - k*(1-k)*h; + +} + + +float rnd(float t) { + return fract(sin(t*745.523)*8956.565); +} + +float curve(float t, float d) { + float g=t/d; + return mix(rnd(floor(g)), rnd(floor(g)+1), pow(smoothstep(0,1,fract(g)), 10)); +} + +float mat = 0; +float map(vec3 p) { + + for(int i=0;i<4; ++i) { + float t1=time*0.2+i +curve(time, 0.3+i*0.3); + p-=0.1+i*0.1; + p.xy *= rot(t1); + p-=0.2+i*0.1; + p.yz *= rot(t1*1.2); + p=abs(p); + p-=0.3+i*0.1; + } + + vec3 p2 = p; + float t2 = time*0.4; + p2.zx *= rot(-t2); + p2.xy *= rot(-t2*1.3); + + float b = box(p, vec3(0.5,0.2,0.3)); + float c = box(p2.xz, 0.2); + float e = cyl(p2.xz, 0.2); + float f =smin(b,-c, -0.1); + + mat = e0.5) break; + prod *=0.9; + side = -side; + d=0.01; + r=refract(r,n, 1+side*0.05); + } + if(d>60) break; + p+=d*r; + } + + col = 1- exp(-col*2); + col = pow(col, vec3(1.2)); + + out_color = vec4(col, vec3(1)); +} \ No newline at end of file diff --git a/2019-01-30/anton1.glsl b/2019-01-30/anton1.glsl new file mode 100644 index 0000000..dfd25e2 --- /dev/null +++ b/2019-01-30/anton1.glsl @@ -0,0 +1,158 @@ +#version 410 core + +uniform float fGlobalTime; // in seconds +uniform vec2 v2Resolution; // viewport resolution (in pixels) + +uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq +uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients +uniform sampler1D texFFTIntegrated; // this is continually increasing +uniform sampler2D cookie; +uniform sampler2D descartes; +uniform sampler2D texNoise; +uniform sampler2D texTex2; + +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything + + +mat2 rot(float a) +{ + float ca = cos(a); + float sa = sin(a); + return mat2(ca,-sa,sa,ca); +} + + +#define PI 3.14159 + +float map(vec3 p) +{ + vec3 cp = p; + p.z -= 10.; + float time = fGlobalTime; + + float acc = 1000.; + + float BPM = 100. / 60.; + + float bump = sin(fract(time * BPM ) * PI - PI * .5) * .5 + .5; + bump = pow(bump,2.); + bump *= .35; + + p *= 1. - bump; + + for(float i = 1.; i <= 6.; i++) +{ + p.x = abs(p.x); + p.xy *= rot(p.y * i * .15 + time); + p.xz *= rot(p.y * i * .125 + time); + p.y += p.x * .3; + + acc = min(acc,length(p) - (1. + i * .1)); + + +} + + + p = cp; + + float flo = p.y +10.; + + return min(acc, flo); +} + +vec3 normal(vec3 p) +{ + vec2 e = vec2(.0,.01); + return normalize(vec3( + map(p + e.xxy) - map(p - e.xxy), + map(p + e.xyx) - map(p - e.xyx), + map(p + e.yxx) - map(p - e.yxx) +)); +} + +void main(void) +{ + vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y); + uv -= 0.5; + uv /= vec2(v2Resolution.y / v2Resolution.x, 1); + + vec3 eye = vec3(0.,0.,-7. + sin(fGlobalTime) * 2.); + vec3 rd = normalize(vec3(uv, 1.)); + vec3 cp = eye; + + float ti = floor(fGlobalTime ) + pow(fract(fGlobalTime), 2.); + + rd.xy *= rot(sin(ti * 2.) * .2); + + + + + + + + + + + + + + + + + + + + + + + + + + float st = 0.; + float cd = 0.; + + for(;st < 1.; st += 1./128.) + { + cd = map(cp); + if(cd < .01) break; + cp += cd * rd * .75; + } + + + out_color = texture(cookie, uv * rot(fGlobalTime) + fGlobalTime * .12); + + + if(cd < .01) +{ + vec3 norm = normal(cp); + float li = dot(norm, vec3(-1.,1.,1.)); + + + + out_color = vec4(li); + + out_color.xy *= rot(fGlobalTime + cp.x); + out_color.xz *= rot(fGlobalTime + cp.z); + +} +} + + + + + + + + + + + + + + + + + + + + diff --git a/2019-01-30/anton2.glsl b/2019-01-30/anton2.glsl new file mode 100644 index 0000000..98c4d95 --- /dev/null +++ b/2019-01-30/anton2.glsl @@ -0,0 +1,118 @@ +#version 410 core + +uniform float fGlobalTime; // in seconds +uniform vec2 v2Resolution; // viewport resolution (in pixels) + +uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq +uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients +uniform sampler1D texFFTIntegrated; // this is continually increasing +uniform sampler2D cookie; +uniform sampler2D descartes; +uniform sampler2D texNoise; +uniform sampler2D texTex2; + +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything +#define PI 3.14159 +float noise(vec2 p) +{ + return fract(dot(p.x * 54523.1235, p.y * 1328.)) ; +} + + + +mat2 rot(float a ) +{ + float ca = sin(a); + float sa = cos(a); + return mat2(sa,-ca,ca,sa); +} + +float ease(float t) +{ + return floor(t) + sin(fract(t) * PI - PI * .5) * .5 + .5; +} + +float map(vec3 p) +{ + float dist = 1000.; + + vec3 cp = p; + +float time = fGlobalTime; + + float bpm = 120 / 60.; + + + + p.z += ease(time * bpm) * 20. ; + + + p.xy *= rot(p.z * .1); + + float st = sin(ease(time * bpm)) * .5 + .5; + +p.xy *= rot(time * st + abs(p.y) * .01); + float cy2 = length(p.xz) - .75; + p.xz = mod(p.xz +10, 20) - 10; + //p.xy *= (-time); + + + dist = min(dist, length(p) - 1.); + + + float cy = length(p.xy) - .5; + + dist = min(dist, cy2); + + dist = max(dist,-cy); + + + cp.xy *= rot(time * .1); + p = cp; + + p.x = abs(p.x); + p.x -=8; + p.z -= 10.; + + + float cd = length(p.xz) - 1.; +dist = min(dist, cd); + + p = cp; + p.y = abs(p.y); + p.y -=8; + p.z -= 10.; + cd = length(p.yz) - 1.; +dist = min(dist, cd); + + return dist; +} + +void main(void) +{ + vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y); + uv -= 0.5; + uv /= vec2(v2Resolution.y / v2Resolution.x, 1); + + vec3 eye = vec3(0.,0.,-10.); +vec3 rd = normalize(vec3(uv,1.)); + vec3 cp = eye; + float cd = 0.; + float st = 0.; + for(; st < 1.; st += 1. / 64.) +{ + float cd = map(cp); + if(cd < .01) break; + + cp += rd * .5 * cd; +} + + out_color = vec4(1. - st); + + float t = fGlobalTime; + + out_color.xz *= rot(t + cp.z); + out_color.xy *= rot(t + cp.y); + out_color.yz *= rot(t + cp.x); + +} \ No newline at end of file diff --git a/2019-01-30/lamogui3.glsl b/2019-01-30/lamogui3.glsl new file mode 100644 index 0000000..cbe63d1 --- /dev/null +++ b/2019-01-30/lamogui3.glsl @@ -0,0 +1,71 @@ +#version 410 core + +uniform float fGlobalTime; // in seconds +uniform vec2 v2Resolution; // viewport resolution (in pixels) + +uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq +uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients +uniform sampler1D texFFTIntegrated; // this is continually increasing +uniform sampler2D cookie; +uniform sampler2D descartes; +uniform sampler2D texNoise; +uniform sampler2D texTex2; + +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything +mat2 r(float a) +{ + float c= cos(a); + float s = sin(a); + return mat2(s, -s , c ,s); +} + +float m(vec3 p) +{ +p.xy *= r(10.0 *3.1415 * fGlobalTime); + float d = cos(p.x) + cos(p.y) + cos(p.z); + + + return d; +} +vec3 r(vec3 ro, vec3 rd, out float st) +{ + vec3 p = ro; +for (float i = 0.0; i < 64.0; i++) +{ + float d = m(p); + if (abs(d)<0.01) +{ + st = i /64.0; + break; +} + p+= rd * d; +} + return p; +} + +vec3 s(vec3 ro, vec3 p) +{ + vec3 c = vec3(exp(-distance(ro, p) * 0.1)); + c *= vec3(1.0 ,0.0, 0.0); + return c; +} +void main(void) +{ + vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y); + uv -= 0.5; + uv /= vec2(v2Resolution.y / v2Resolution.x, 1); + + + + vec3 rd = normalize(vec3(uv, 1.0)); + vec3 ro = vec3(0.0, 0.0, 10.0* texture(texFFTIntegrated, 0.01).x); +float st = 1.0; + vec3 p = r(ro, rd, st); + vec3 c = s(ro, p); + c = mix (c, texture(cookie, p.xz + fGlobalTime).rgb, 0.5); + +p.xz = r(fGlobalTime) * uv; + c = mix (c, texture(descartes, p.xy).rgb, 0.3); +c += fract(fGlobalTime * 10.0); + out_color = vec4(c, 1.0); +} \ No newline at end of file diff --git a/2019-01-30/leon2.glsl b/2019-01-30/leon2.glsl new file mode 100644 index 0000000..fb9d604 --- /dev/null +++ b/2019-01-30/leon2.glsl @@ -0,0 +1,93 @@ +#version 410 core + +uniform float fGlobalTime; // in seconds +uniform vec2 v2Resolution; // viewport resolution (in pixels) + +uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq +uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients +uniform sampler1D texFFTIntegrated; // this is continually increasing +uniform sampler2D cookie; +uniform sampler2D descartes; +uniform sampler2D texNoise; +uniform sampler2D texTex2; + +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything + +#define time fGlobalTime +#define repeat(p,r) (mod(p,r)-r/2.) + +mat2 rot(float a) { float c=cos(a), s=sin(a); return mat2(c,s,-s,c); } + +vec3 look (vec3 eye, vec3 at, vec2 uv) { + vec3 front = normalize(at-eye); + vec3 right = normalize(cross(front, vec3(0,1,0))); + vec3 up = normalize(cross(front, right)); +float fov = (1.+.5*sin(time*8.)); + return normalize(front * .3 + right * uv.x + up * uv.y); + } + +float map (vec3 pos) { + float scene = 10.; +pos.z -= time * 10.; +pos = repeat(pos, 5.); + + const float count = 3.; +vec3 p = pos; + for (float i = count; i > 0.; --i) { + float r = i / count; + p = abs(p)-(.5+.3*sin(time*8.))*r; + p.xz *= rot(time*.2); + p.yz *= rot(time*.1); +float rr = .2+.1*sin(time* 8.); +rr *= r; + if (sin(time)<.0) { + scene = min(scene, length(p)-rr); + } else { +scene = min(scene, length(p.xz)-rr*.2); + scene = min(scene, length(p.yz)-rr*.2); + scene = min(scene, length(p.xy)-rr*.2); +} +} + + //scene = min(scene, max(0., (length(pos.xz)-1.))); + + pos.xz *= rot(pos.y + time *4.0+ sin(time*4.+pos.y)); + pos.x += 1.; + + pos.xz *= abs(pos.xz)-.5; + pos.xz *= abs(pos.xz)-.5; +//scene = min(scene, length(pos.xz)-.02); + return scene; +} + +void main(void) +{ + vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y); + uv -= 0.5; + uv /= vec2(v2Resolution.y / v2Resolution.x, 1); +vec2 p = uv; + uv /= 1.-length(uv)*4.; + vec3 eye = vec3(0,0,-3); + eye.xz *= rot(time*.8); + eye.yz *= rot(time * .5); + vec3 ray = look(eye, vec3(0), uv); + vec3 pos = eye; + float shade = 0.; + const float count = 50.; + for (float i = count; i > 0.; --i) { + float dist = map(pos); + if (dist < .001) { + shade = i / count; + break; + } + pos += ray * dist; + } +vec3 color = vec3(.5)+vec3(1.)*cos(vec3(.01,.011,.0123)*time*5.+shade*2.+length(pos)*2.); + float funk = step(.0, sin(-time*4.+length(uv)*4.+atan(uv.y,uv.x))); + color = mix(color, 1.-color, funk); + + p.y-=sqrt(abs(p.x))*.5*(1.+.2*sin(time*4.)); + float heart = step(.0, length(p)-.2); +out_color = vec4(color*shade, 1.); +out_color.r += 1.-heart; +} \ No newline at end of file diff --git a/2019-01-30/momo1.glsl b/2019-01-30/momo1.glsl new file mode 100644 index 0000000..c33ee41 --- /dev/null +++ b/2019-01-30/momo1.glsl @@ -0,0 +1,82 @@ +#version 410 core + +uniform float fGlobalTime; // in seconds +uniform vec2 v2Resolution; // viewport resolution (in pixels) + +uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq +uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients +uniform sampler1D texFFTIntegrated; // this is continually increasing +uniform sampler2D cookie; +uniform sampler2D descartes; +uniform sampler2D texNoise; +uniform sampler2D texTex2; + +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything + +vec2 rot(vec2 v, float a) +{ + return mat2(cos(a), sin(a), -sin(a), cos(a))*v; +} + +float map(vec3 p) +{ + p.xy = rot(p.xy, .1*p.z); + + vec3 q = mod(p, 12.) -6; + + return length(q) - 5.; +} + +vec3 gn(vec3 p) +{ + vec2 e = vec2(0., 0.001); + return normalize(vec3(map(p-e.yxx)-map(p+e.yxx), + map(p-e.xyx)-map(p+e.xyx), + map(p-e.xxy)-map(p+e.xxy))); +} + +void main(void) +{ + vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y); + uv *= 2.; + uv -= 1.; + uv /= vec2(v2Resolution.y / v2Resolution.x, 1); + + uv = rot(uv, -0.5*fGlobalTime); + + vec3 o = vec3(0., 0., 10.*fGlobalTime); + vec3 p = o; + vec3 rd = normalize(vec3(uv,1.)); + + int i = 0; + + for(i = 0; i < 64; ++ i) + { + float d = map(p); + p += rd*d; + if(d<0.001) + break; + } + + float c1 = float(i)/64.*4.; + + vec3 n = gn(p); + + vec3 rd2 = reflect(rd, n); + + vec3 p2 = p+.1*rd2; + + for(i = 0; i < 64; ++ i) + { + float d = map(p2); + p2 += rd2*d; + if(d<0.001) + break; + } + + float c2 = float(i)/64.*4.; + + vec3 co = mix(vec3(c1*c2), vec3(0., 0.3, 0.4), 1.-exp(-distance(p, o)*.035)); + + out_color = vec4(co, 1.);; +} \ No newline at end of file