diff --git a/2022-10-19_FabriqueACookie01/Flopine.png b/2022-10-19_FabriqueACookie01/Flopine.png new file mode 100644 index 0000000..a3f1e51 Binary files /dev/null and b/2022-10-19_FabriqueACookie01/Flopine.png differ diff --git a/2022-10-19_FabriqueACookie01/Leon.png b/2022-10-19_FabriqueACookie01/Leon.png new file mode 100644 index 0000000..3ce1c00 Binary files /dev/null and b/2022-10-19_FabriqueACookie01/Leon.png differ diff --git a/2022-10-19_FabriqueACookie01/Readme.md b/2022-10-19_FabriqueACookie01/Readme.md new file mode 100644 index 0000000..898b8e0 --- /dev/null +++ b/2022-10-19_FabriqueACookie01/Readme.md @@ -0,0 +1,14 @@ +# Performances + +On October 19, 2022 on [La fabrique à cookie 01](https://fb.me/e/5XUob53d2). + +## Shaders + +1. Leon Denise +![](https://raw.githubusercontent.com/CookieCollective/Live-Coding-Sources/master/2022-10-19_FabriqueACookie01/Leon.png) +2. Flopine +![](https://raw.githubusercontent.com/CookieCollective/Live-Coding-Sources/master/2022-10-19_FabriqueACookie01/Flopine.png) + + +## Software +- [Bonzomatic](https://github.com/TheNuSan/Bonzomatic/) diff --git a/2022-10-19_FabriqueACookie01/flopine.glsl b/2022-10-19_FabriqueACookie01/flopine.glsl new file mode 100644 index 0000000..4bef4c2 --- /dev/null +++ b/2022-10-19_FabriqueACookie01/flopine.glsl @@ -0,0 +1,100 @@ + #version 410 core + + uniform float fGlobalTime; // in seconds + uniform vec2 v2Resolution; // viewport resolution (in pixels) + uniform float fFrameTime; // duration of the last frame, in seconds + + 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 texPreviousFrame; // screenshot of the previous frame + uniform sampler2D texChecker; + uniform sampler2D texNoise; + uniform sampler2D texTex1; + uniform sampler2D texTex2; + uniform sampler2D texTex3; + uniform sampler2D texTex4; + + layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything +/* + vec4 plas( vec2 v, float time ) + { + float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 ); + return vec4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 ); + } + */ + #define circle(u,s) (length(u)-s) + #define sm(t,v) smoothstep(t, t*1.05, v) + + #define hash21(x) fract(sin(dot(x,vec2(145.2, 210.8)))-164.5) + #define PI acos(-1.) + #define time fGlobalTime + + void mo (inout vec2 p, vec2 d) + { + p = abs(p)-d; + if (p.y>p.x) p=p.yx; + } + + float truchet (vec2 uv) + { + vec2 id = floor(uv); + if(hash21(id)<.5) uv.x *=-1.; + uv = fract(uv)-.5; + + float a = atan(uv.y,uv.x); + a = cos(a*2.+time); + float s = uv.x>-uv.y ? 1.:-1.; + + uv -= .5*s; + //return sm(0.1, abs(circle(uv, 0.5)) ); + return abs(circle(uv, 0.5)) ; + } + + float extrude (vec3 p, float d, float h) + { + vec2 q = vec2(d, abs(p.z)-h); + return min(0., max(q.x,q.y))+length(max(q,0.)); + } + + float SDF (vec3 p) + { + p.z += time; + float per = 5.; + p.z = mod(p.z, per)-per*.5; + return extrude(p, truchet(p.xy),0.1)-0.3; + } + + + void main(void) + { + vec2 uv = vec2(2.*gl_FragCoord.xy-v2Resolution.xy)/ v2Resolution.y; + uv *= 5.; + mo(uv,vec2(0.5)); + vec3 ro = vec3(0.001,0.001,-2.), rd=normalize(vec3(uv,1.)),p=ro, col=vec3(truchet(uv)); + + bool hit = false; float shad; + for (float i=0.; i<64.; i++) + { + float d = SDF(p); + if(d<0.001) + { + hit=true; shad = i/64.; break; + } + p += d*rd; + } + + if (hit) + { + col = vec3(1.-shad*3.); + } + float t = length(p-ro); + //vec3 col = vec3(t); + + col = mix(col, vec3(0.8,0.,0.1), 1.-exp(-0.01*t*t)); + + float mask = texture(texFFTSmoothed, abs((uv.x-uv.y)*0.5)-0.25).x*1000.; + + if (mask>.5) col = vec3(0.8, 0.05, 0.1); + out_color = vec4(sqrt(col), 1.);; + } \ No newline at end of file diff --git a/2022-10-19_FabriqueACookie01/leon.glsl b/2022-10-19_FabriqueACookie01/leon.glsl new file mode 100644 index 0000000..5fdfb3c --- /dev/null +++ b/2022-10-19_FabriqueACookie01/leon.glsl @@ -0,0 +1,178 @@ + #version 410 core + + uniform float fGlobalTime; // in seconds + uniform vec2 v2Resolution; // viewport resolution (in pixels) + uniform float fFrameTime; // duration of the last frame, in seconds + + 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 texPreviousFrame; // screenshot of the previous frame + uniform sampler2D texChecker; + uniform sampler2D texNoise; + uniform sampler2D texTex1; + uniform sampler2D texTex2; + uniform sampler2D texTex3; + uniform sampler2D texTex4; + + float fft; + + layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything +/* + vec4 plas( vec2 v, float time ) + { + float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 ); + return vec4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 ); + } + */ + #define circle(u,s) (length(u)-s) + #define sm(t,v) smoothstep(t, t*1.05, v) + #define repeat(p,r) (mod(p,r)-r*.5) + #define hash21(x) fract(sin(dot(x,vec2(145.2, 210.8)))-164.5) + #define PI acos(-1.) + float time = mod(fGlobalTime*.3, 300.); + + mat2 rot(float a) { + float ca=cos(a); + float sa=sin(a); + return mat2(ca,sa,-sa,ca); + } + + void mo (inout vec2 p, vec2 d) + { + p = abs(p)-d; + if (p.y>p.x) p=p.yx; + } + + float truchet (vec2 uv) + { + vec2 id = floor(uv); + if(hash21(id)<.5) uv.x *=-1.; + uv = fract(uv)-.5; + + float a = atan(uv.y,uv.x); + a = cos(a*2.+time); + float s = uv.x>-uv.y ? 1.:-1.; + + uv -= .5*s; + //return sm(0.1, abs(circle(uv, 0.5)) ); + return abs(circle(uv, 0.5)) ; + } + + float extrude (vec3 p, float d, float h) + { + vec2 q = vec2(d, abs(p.z)-h); + return min(0., max(q.x,q.y))+length(max(q,0.)); + } + + + float rnd(float t) { + return fract(sin(t*532.524)*714.521); + } + float curve(float t, float d) { + t/=d; + return mix(rnd(floor(t)),rnd(floor(t+1)), pow(smoothstep(0,1,fract(t)),10.)); + } + + float box(vec3 p, vec3 s) { + p=abs(p)-s; + return max(p.x, max(p.y,p.z)); + + } + + float SDF (vec3 p) + { + vec3 p2=p;//+vec3(0,0,0.7); + vec3 p3=p; + p.z += time; + float per = 5.; + p.z = mod(p.z, per)-per*.5; + float d= extrude(p, truchet(p.xy),0.1)-0.3; + + d=10000; + p2.z += time; + + float pz = p2.z; + + p2 = repeat(p2, 2.); + + p2.xz *= rot(time); + p2.yz *= rot(0.7*time); + p2=abs(p2); + float a = 1.; + float t = time * .1 + pz * 0.5 + fft * 5.; + for(int i=0; i<5;i++) { + p2.xz *= rot(t*.8 + curve(time, 2.7)*4); + p2.yz *= rot(t*.7/a); + p2.xz=abs(p2.xz)-.8*a; + //p2.x-=0.6+curve(time, .7)*.01; + d = min(d, length(p2)-.1*a-fft*50.); + a /= 1.8; + //d=min(d, box(p2, vec3(0.3))); + + } + //d=min(d, length(p2.xz)-.1); + //d=max(d, -p3.z-2.5+length(p3)*.3); + //d+=max(0,length(p3)-2.); + d = max(abs(d)-.001, -(length(p.xy)-.5)); + return d; + } + + + void main(void) + { + vec2 uv = vec2(2.*gl_FragCoord.xy-v2Resolution.xy)/ v2Resolution.y; + //uv *= 5.; + vec2 uv2=uv; + //uv *= .5+curve(time, .3); + // uv *= rot(time*.3-sin(length(uv)-time*5.)*.1); + + for(int i=0;i<3; ++i) { + //uv.x=abs(uv.x); + //uv *= rot(curve(time, .2)+time*.3+i); + } + fft = texture(texFFTSmoothed, 0.).r; + + //mo(uv,vec2(0.5)); + vec3 ro = vec3(0.001,0.001,-2.), rd=normalize(vec3(uv,1.)),p=ro, col=vec3(0); + rd.xy *= rot(time); + rd.yz *= rot(time); + bool hit = false; float shad; + float d=0; + for (float i=0.; i<64.; i++) + { + d = SDF(p); + if(d<0.001) + { + hit=true; shad = i/64.; break; + } + p += d*rd; + } + + if (hit) + { + col = vec3(1.-shad*3.); + } + float t = length(p-ro); + //vec3 col = vec3(t); + + //col = mix(col, vec3(0.8,0.,0.1), 1.-exp(-0.01*t*t)); + //col.xz *= rot(t*.3); + + if(length(uv2)>-5+texture(texFFTSmoothed, 0.01).x*400.) { + + + float mask = texture(texFFTSmoothed, abs((uv.x-uv.y)*0.5)-0.25).x*1000.; + + //if (mask>.5) col = vec3(0.8, 0.05, 0.1); + + float t2=time*.2 + uv.x*.05 + length(p)*.1 + rnd(floor(abs(uv2.x)*1.-time)); + //col.xz *= rot(t2); + //col.yz *= rot(-t2*.7); + col=abs(col); + col = .5+.5*cos(vec3(1,2,3)*5.+floor(p.z*4.)*.1+time*10.); + col *= shad; + + } + out_color = vec4(sqrt(col), 1.);; + } \ No newline at end of file diff --git a/2022-11-09/z0rg.png b/2022-10-19_FabriqueACookie01/z0rg.png similarity index 100% rename from 2022-11-09/z0rg.png rename to 2022-10-19_FabriqueACookie01/z0rg.png diff --git a/2022-11-09/Readme.md b/2022-11-09_FabriqueACookie02/Readme.md similarity index 100% rename from 2022-11-09/Readme.md rename to 2022-11-09_FabriqueACookie02/Readme.md diff --git a/2022-11-09/SAM.png b/2022-11-09_FabriqueACookie02/SAM.png similarity index 100% rename from 2022-11-09/SAM.png rename to 2022-11-09_FabriqueACookie02/SAM.png diff --git a/2022-11-09/lsdlive.png b/2022-11-09_FabriqueACookie02/lsdlive.png similarity index 100% rename from 2022-11-09/lsdlive.png rename to 2022-11-09_FabriqueACookie02/lsdlive.png diff --git a/2022-11-09/shader_SAM.glsl b/2022-11-09_FabriqueACookie02/shader_SAM.glsl similarity index 100% rename from 2022-11-09/shader_SAM.glsl rename to 2022-11-09_FabriqueACookie02/shader_SAM.glsl diff --git a/2022-11-09/shader_lsdlive.glsl b/2022-11-09_FabriqueACookie02/shader_lsdlive.glsl similarity index 100% rename from 2022-11-09/shader_lsdlive.glsl rename to 2022-11-09_FabriqueACookie02/shader_lsdlive.glsl diff --git a/2022-11-09/shader_z0rg.glsl b/2022-11-09_FabriqueACookie02/shader_z0rg.glsl similarity index 100% rename from 2022-11-09/shader_z0rg.glsl rename to 2022-11-09_FabriqueACookie02/shader_z0rg.glsl diff --git a/2022-11-09_FabriqueACookie02/z0rg.png b/2022-11-09_FabriqueACookie02/z0rg.png new file mode 100644 index 0000000..a1656d4 Binary files /dev/null and b/2022-11-09_FabriqueACookie02/z0rg.png differ diff --git a/2022-12-07/Readme.md b/2022-12-07_FabriqueACookie03/Readme.md similarity index 100% rename from 2022-12-07/Readme.md rename to 2022-12-07_FabriqueACookie03/Readme.md diff --git a/2022-12-07/cosamentale.png b/2022-12-07_FabriqueACookie03/cosamentale.png similarity index 100% rename from 2022-12-07/cosamentale.png rename to 2022-12-07_FabriqueACookie03/cosamentale.png diff --git a/2022-12-07/leon.png b/2022-12-07_FabriqueACookie03/leon.png similarity index 100% rename from 2022-12-07/leon.png rename to 2022-12-07_FabriqueACookie03/leon.png diff --git a/2022-12-07/nusan.png b/2022-12-07_FabriqueACookie03/nusan.png similarity index 100% rename from 2022-12-07/nusan.png rename to 2022-12-07_FabriqueACookie03/nusan.png diff --git a/2022-12-07/shader_cosamentale.glsl b/2022-12-07_FabriqueACookie03/shader_cosamentale.glsl similarity index 100% rename from 2022-12-07/shader_cosamentale.glsl rename to 2022-12-07_FabriqueACookie03/shader_cosamentale.glsl diff --git a/2022-12-07/shader_leon.glsl b/2022-12-07_FabriqueACookie03/shader_leon.glsl similarity index 100% rename from 2022-12-07/shader_leon.glsl rename to 2022-12-07_FabriqueACookie03/shader_leon.glsl diff --git a/2022-12-07/shader_nusan.glsl b/2022-12-07_FabriqueACookie03/shader_nusan.glsl similarity index 100% rename from 2022-12-07/shader_nusan.glsl rename to 2022-12-07_FabriqueACookie03/shader_nusan.glsl diff --git a/2022-12-07/shader_z0rg.glsl b/2022-12-07_FabriqueACookie03/shader_z0rg.glsl similarity index 100% rename from 2022-12-07/shader_z0rg.glsl rename to 2022-12-07_FabriqueACookie03/shader_z0rg.glsl diff --git a/2022-12-07/z0rg.png b/2022-12-07_FabriqueACookie03/z0rg.png similarity index 100% rename from 2022-12-07/z0rg.png rename to 2022-12-07_FabriqueACookie03/z0rg.png