diff --git a/2021-05-21/01_shadow_nusan.glsl b/2021-05-21/01_shadow_nusan.glsl new file mode 100644 index 0000000..8187c9c --- /dev/null +++ b/2021-05-21/01_shadow_nusan.glsl @@ -0,0 +1,177 @@ +#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 texRevision; +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 + +float fft(float t) { return texture(texFFTSmoothed, fract(t)*.4).x/texture(texFFTSmoothed, 0.001).x; } +float ffti(float t) { return texture(texFFTIntegrated, fract(t)*.4).x; } + +float time=mod(fGlobalTime,300); +float box(vec3 p, vec3 s) { p=abs(p)-s; return max(p.x, max(p.y,p.z)); } +mat2 rot(float a) { float ca=cos(a); float sa=sin(a); return mat2(ca,sa,-sa,ca); } + +float rnd(float t) { + return fract(sin(t*452.512)*352.544); +} + +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 ca=0; +float caid=0; + +int id=0; +vec3 pu=vec3(0); +float map(vec3 p) { + + vec3 bp=p; + + for(int i=0; i<5; ++i) { + float t=i*3.7+2.7 + rnd(caid)*8; + p.yz *= rot(t); + p.xz *= rot(t*.7); + p.xz=abs(p.xz)-0.9 - rnd(caid); + } + + float d = length(p)-1; + + float s=1; + float t2 = time*.3 + curve(time, .5)*7; + float st = 0.2 + curve(time, .7)*.7; + vec3 p1=(fract(bp/s+.5)-.5)*s; + float a1=sin(dot(p1.xy,vec2(.8))+t2)*st; + float d1 = abs(length(p1.xy)-.2)-.05; + vec3 p2=(fract((bp+s*.5)/s+.5)-.5)*s; + float a2=sin(dot(p2.yz,vec2(.2))+t2*.7)*st; + float d2 = abs(length(p2.yz)-.2)-.05; + vec3 p3=(fract((bp+vec3(s*.5,0,0))/s+.5)-.5)*s; + float a3=sin(dot(p1.xz,vec2(.3))+t2*1.3)*st; + float d3 = abs(length(p3.xz)-.2)-.05; + + float dd = max(d1, d - a1); + float dd2 = max(d2, d - a2); + float dd3 = max(d3, d - a3); + id=0; + if(dd2100.0) { break; } + p+=r*d; + atm += 0.015/(max(1.5,d-10.5)); + } + + vec3 diff=vec3(1,.9,.3); + if(id==1) diff=vec3(.6,.5,1); + if(id==2) diff=vec3(.3,1,.4); + + col += pu*.01; + + vec3 l=normalize(vec3(1,3,2)); + + float sss=0; + vec3 p2=p; + vec3 r2=l*.08; + for(int i=0; i<50; ++i) { + float d=map(p2); + sss += d*.01; + p2+=r2; + } + + float fog=1-clamp(length(p-s)/100.0,0,1); + + //col += map(p-r) * fog * diff; + vec2 off=vec2(0.01,0); + vec3 n=normalize(map(p)-vec3(map(p-off.xyy), map(p-off.yxy), map(p-off.yyx))); + vec3 h=normalize(l-r); + float spec = max(dot(n,h),0); + float fre=pow(1-abs(dot(n,r)),3); + + col += sss * fog * (diff + diff*pow(spec,10) + pow(spec, 50)); + col += sss * fog * diff * fre * 2; + atm *= (1-fog); + + atm += texture(texPreviousFrame, gl_FragCoord.xy / v2Resolution.xy).w*pow(curve(time, .2),.4); + + vec2 uv2 = uv; + for(int i=0; i<10; ++i) { + float t3=time*.3; + uv2*=rot(t3); + atm += 0.007/(0.001+abs(uv2.x)) * pow(1-fog,10) * pow(curve(time+i*2.73,.5),10); + uv2=abs(uv2); + uv2-=.3; + } + + vec3 aaa=vec3(vec3(.5,.2,.9)+sin(atm*vec3(10,1,2) + time)); + col += (aaa*.2+.8)*atm*.2; + + + //col += pow(1-fog,3)*.01/(0.01+abs(fract(.5*ffti(floor(abs(uv.x)*30)/30))*2-1-uv.y)); + + col=smoothstep(0,1,col); + col=pow(col, vec3(0.4545)); + + out_color = vec4(col, atm); +} \ No newline at end of file diff --git a/2021-05-21/01_shadow_ponk.glsl b/2021-05-21/01_shadow_ponk.glsl new file mode 100644 index 0000000..40ad51a --- /dev/null +++ b/2021-05-21/01_shadow_ponk.glsl @@ -0,0 +1,109 @@ + +#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 + +#define time fGlobalTime +float hash (vec2 seed) { return fract(sin(dot(seed*.1684,vec2(54.649,321.547)))*450315.); } + +mat2 rot (float a) { float c=cos(a), s=sin(a); return mat2(c,-s,s,c); } +#define repeat(p, r) (mod(p,r)-r/2.) + +float dither; +float material; +float glow; + +float map(vec3 p) +{ + float dist = 1000.; + float shape = 1000.; + + float cell = 12.; + float idz = floor((p.z+time*.2)/cell); + //p.z = repeat(p.z+time, cell); + float cycle = 1.; + float spawn = pow(sin(fract(time/cycle)*3.14), 10.); + const int count = 6; + float r = 1.3; + float s = 0.1; + float f = 1.8; + float h = 0.2; + float a = 1.0; + float t = time*0.5+dither*0.05+p.x*.2;//+idz; + for (int index = count; index > 0; --index) + { + p.xy *= rot(0.1*t/a); + p.xz *= rot(sin(t/a)+t); + p.yz *= rot(t+sin(t*4.)); + p.z = abs(p.z)-r*a; + shape = max(length(p.xz)-s*a, abs(p.y)-h*a); + material = shape < dist ? float(index) : material; + dist = min(shape, dist); + a /= f; + } + //dist = length(p)-s; + dist = min(dist, length(p)-.05*spawn); + + return dist; +} + +void main(void) +{ + float delay = 4.; + vec2 uv = (gl_FragCoord.xy-0.5*v2Resolution.xy)/v2Resolution.y; + + //uv *= rot(time*0.1); + dither = hash(uv+fract((time))); + glow = 0.; + vec3 color = vec3(0.);//*smoothstep(0.0, 2.0, length(uv)); + vec3 eye = vec3(0,0,-6); + vec3 ray = normalize(vec3(uv, 2.)); + vec3 pos = eye + ray * (2.+dither*1.); + const int steps = 40; + for (int index = steps; index > 0; --index) + { + float dist = map(pos); + if (dist < 0.001) + { + float shade = float(index)/float(steps); + vec3 tint = vec3(0.25)+vec3(0.75)*cos(vec3(1,2,3)*.8+material*.1+1.+pos.z*2.+uv.y*1.+shade+floor(time/delay)*8.3); + color = tint * shade; + break; + } + + if (material == floor(mod(time, 8.))) + { + float fade = fract(time); + //glow += sin(fade*3.14)*clamp(0.01/max(0., dist),0.,1.); + } + pos += dist * ray; + } + + color += vec3(1)*glow; + + vec2 splash = -uv * 20.*length(uv)/v2Resolution; + vec3 frame = texture(texPreviousFrame, gl_FragCoord.xy/v2Resolution.xy+splash).rgb; + + color = max(color, frame); + + float reset = fract(time/delay); + color *= smoothstep(1.0, 0.9, reset); + + out_color = vec4(color,1); +} + diff --git a/2021-05-21/02_shadow_evvvvil.glsl b/2021-05-21/02_shadow_evvvvil.glsl new file mode 100644 index 0000000..2ff16fb --- /dev/null +++ b/2021-05-21/02_shadow_evvvvil.glsl @@ -0,0 +1,179 @@ +#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; +uniform sampler2D texWormhole; +layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything +vec2 z,v,e=vec2(.0035,-.0035); float t,tt,b,bb,g,cr,gg,ggg,f,tn; vec3 ro,np,rp,bp,cp,pp,op,sp,po,no,al,lp,ld,cop;vec4 su=vec4(0);float ffBass, ffHigh, ffWhole; +float noi(vec3 p){ vec3 f=floor(p),s=vec3(7,157,113); p-=f;vec4 h=vec4(0,s.yz,s.y+s.z)+dot(f,s); p=p*p*(3.-2.*p); + h=mix(fract(sin(h)*43758.5),fract(sin(h+s.x)*43758.5),p.x); h.xy=mix(h.xz,h.yw,p.y); return mix(h.x,h.y,p.z);} +float cno(vec3 p,float k){ float f=0.; p.z+=tt*k;f+=0.5*noi(p);p=2.1*p;f+=0.25*noi(p+1.);p=2.2*p; f+=0.125*noi(p+2.);p=2.3*p; return f;} +float bo(vec3 p,vec3 r){p=abs(p)-r; return max(max(p.x,p.y),p.z);} +float oc(vec3 p,float s){p=abs(p);return (p.x+p.y+p.z-s)*0.57735;} +float b2d(vec2 p,vec2 r){ p=abs(p)-r;return length(max(p,0))+min(max(p.x,p.y),0);} +float cy(vec3 p,vec3 r){return max(abs(length(p.xz)-r.x)-r.y,abs(p.y)-r.z/2.);} +float cx(vec3 p,vec3 r){return max(abs(length(p.yz)-r.x)-r.y,abs(p.x)-r.z/2.);} +float cz(vec3 p,vec3 r){return max(abs(length(p.xy)-r.x)-r.y,abs(p.z)-r.z/2.);} +float cap(vec3 p, float h, float r ){ p.y -= clamp( p.y, 0.0, h );return length( p ) - r;} +float ext(vec3 p,float sdf,float h){ vec2 w=vec2(sdf,abs(p.y)-h); return min(max(w.x,w.y),0.)+length(max(w,0));} +vec2 smin( vec2 a, vec2 b,float k ){ float h=clamp(.5+.5*(b.x-a.x)/k,.0,1.);return mix(b,a,h)-k*h*(1.0-h);} +mat2 r2(float r){return mat2(cos(r),sin(r),-sin(r),cos(r));} +float smin( float d1, float d2, float k ){float h=max(k-abs(d1-d2),0.0);return min(d1, d2) - h*h*0.25/k;} +float smax( float d1, float d2, float k ){float h=max(k-abs(-d1-d2),0.0);return max(-d1,d2)+h*h*0.25/k;} +/* VOLUMETRIC CLOUDS */ +float cmp( vec3 p){ + ffWhole = texture( texFFTSmoothed, 0.02+abs(p.y)*.001).r*200; + float t=length(p)-3-ffWhole; + t=smin(t,length(p.xz)-2-cos(p.y*.2),1.); + t*=0.5; + return t; +} +/* ORBITTTTTTTTT */ +vec4 c=vec4(4.57,7,25,0.2); + +/* MMMAAAAPPPPPPPPPPPPPPPPPPPP*/ +vec2 mp( vec3 p, float ga ){ + //p=vec3(atan(p.x,p.z)*8.,abs(abs(p.y)-25.)-7.,length(p.xz)-5.-bb); + //p=vec3(abs(atan(p.z,p.x))*10.-5., (10.-length(p)), abs(atan(length(p.xz),p.y))*10.); + ffWhole = texture( texFFTSmoothed, 0.02+abs(p.y)*.01).r*300; + op=p; + p.xz=abs(p.xz)-5-cos(p.y*.2)*4.-ffBass; + //float ta=smoothstep(0.,1.,(clamp(sin(p.y*.01+tt*.5),-.25,.25)*2.+.5)); + //p=mix(p,p.xzy,ta); + //float mxr=clamp(sin(tt*.65+p.z*.1),-.5,.5)+.5; + +vec3 gr=clamp(sin(p*5),-.5,.5)*.1; + + vec2 h,t=vec2(bo(p,vec3(3,10,3)-gr.x+gr.y-gr.z+ffHigh),5); //CUBE BLUE + float szr=cos(p.y*.5)*ffWhole*.05; + t.x=abs(t.x)-.2; + t.x=max(t.x,abs(p.y)-3); + t.x*=0.7; + + h=vec2(bo(p,vec3(3.1,10,3)-gr.x+gr.y-gr.z+szr+ffHigh),6); //CUBE WHITE + h.x=abs(h.x)-.4; + h.x=max(h.x,(abs(abs(abs(p.y)-1.6)-.8)-.4)); + + tn=texture(texNoise,p.xy*.1).r; + h.x=min(h.x,length(p.xz)-1-tn+ffWhole*.1); // WHITE CYL MIDDLE + + float glo=abs(bo(p,vec3(2,10,2)-gr.x+gr.y-gr.z))-.01; //GLOW BOX INSIDE + + + glo=max(glo,abs(p.y)-3.6-ffBass); //GLOW BOX INSIDE + gg+=0.1/(0.1*glo*glo*(400-390*cos(p.y*.2+ffBass*4+1.5))); + h.x=min(h.x,glo); + + h.x*=0.75; + + t=t.x120) break; + t.x+=h.x;t.y=h.y; + } if(t.x>120) t.y=0; + return t; +} +#define a(d) clamp(mp(po+no*d,0).x/d,0.,1.) +#define s(d) smoothstep(0.,1.,mp(po+ld*d,0).x/d) +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); + tt=mod(fGlobalTime,62.82); + //bb=max(0.,-3.+floor(tt*.25)+smoothstep(0.,1.,min(fract(tt*.25),.25)*4.)); + //b=smoothstep(0.,1.,clamp(sin(tt*.5),-.25,.25)*2.+.5); + + //// FEUFEUTEU + ffBass = texture( texFFTSmoothed, 0.05 ).r*200; + ffHigh = texture( texFFTSmoothed, 0.3 ).r*350; + + ///////////////////////// CCCCCCAAAAAAAAAAAAAMMMMMMMM + ro=mix(vec3(cos(tt*c.w+c.x)*c.z,c.y,sin(tt*c.w+c.x)*c.z), + vec3(cos(tt*.4)*9,sin(tt)*5,-18), + ceil(sin(tt*.4))); + vec3 cw=normalize(vec3(0)-ro), cu=normalize(cross(cw,vec3(0,1,0))), cv=normalize(cross(cu,cw)), + rd=mat3(cu,cv,cw)*normalize(vec3(uv,.5)),co,fo; + + ///////// BACKGROUND + tn=texture(texNoise,rd.xz).r; + float ffMain=texture( texFFTSmoothed, .01+abs(rd.y)*.5*(1-tn*.5)).r*150; + + co=fo=clamp(vec3(.13,.12,.1)-length(uv)*.2+texture(texNoise,rd.xz).r*.1*ffMain,0.,1.); + + //////// LIGHT POS + lp=ro+vec3(0,2,0); + z=tr(ro,rd);t=z.x; + if(z.y>0){ + po=ro+rd*t; + no=normalize(e.xyy*mp(po+e.xyy,0).x+ + e.yyx*mp(po+e.yyx,0).x+ + e.yxy*mp(po+e.yxy,0).x+ + e.xxx*mp(po+e.xxx,0).x);al=mix(vec3(.0,0.20,.7),vec3(.1,0.40,.5),sin(cop*2.5)*.5+.5); + if(z.y<5)al=vec3(0); + if(z.y>5)al=vec3(1); + ld=normalize(lp-po); + float attn=1.0-pow(min(1.0,length(lp-po)/30.),4.0), + dif=max(0,dot(no,ld)), + fr=pow(1+dot(no,rd),4), + sp=pow(max(dot(reflect(-ld,no),-rd),0),30); + co=mix((sp+al*(a(.1)*a(.3)+.2)*(dif+s(1)*.3))*attn,fo,min(fr,.5)); + co=mix(fo,co,exp(-.00002*t*t*t)); + } + cr=cmp(ro)-2.+fract(dot(sin(uv*476.567+uv.yx*785.951+tt),vec2(984.156))); + for(int i=0;i<120;i++){ + cp=ro+rd*(cr+=1./3.);//(cr+=60./150.); + if(su.a>.99||cr>t) break; + float de=clamp(-cmp(cp)+2.*cno(cp,10.),0.,1.); //-0.2-mp(cp).x+0.5*cno(cp*0.5,1.) + su+=vec4(vec3(mix(1.,0.,de)*de),de)*(1.-su.a); + } + co=mix(co,su.xyz,su.a*0.8); //mix(su.xyz,fo,1.-exp(-.000005*cr*cr*cr)),su.a*.9) + //float light=clamp(-0.5-mp(cp-ld*.5).x+2.5*cno(cp*5,5),0.,1.);//cloud lighting + //su+=vec4(vec3(mix(de*de,light,de)),de)*(1-su.a); //co=su.xyz; + co=co+g*.2*vec3(.0,.1,.7)+gg*.2*vec3(1.,.5,.1)+ggg*.2; + //if(length(lp-ro) 0.) + { + vec3 p = ro + rd * res.y; + vec3 n = getNorm(res.x, p); + col = n * .5 + .5; + if (res.z == 1.) + { + col = vec3(.25); + col += vec3(.75,0.2,.14)*pow(sat(-dot(rd, n)),5.); + if (res.z == 0.) + col = vec3(0.); + } + } + col += accCol.zxy; + return col; +} + +vec3 rdr2(vec2 uv) +{ + vec2 dir = normalize(vec2(1.)); + float strength = .01; + vec3 col = vec3(0.); + col.r = rdr(uv+strength*dir).x; + col.g = rdr(uv).y; + col.b = rdr(uv-strength*dir).z; + return col; +} + +void main(void) +{ + vec2 uv = (gl_FragCoord.xy-vec2(.5)*v2Resolution.xy)/v2Resolution.xx; + + /* + float f = texture( texFFT, d ).r * 100; + m.x += sin( fGlobalTime ) * 0.1; + m.y += fGlobalTime * 0.25; +*/ + vec3 col = vec3(0.); + col = rdr2(uv)*.5; + + float stp = 0.025; + uv = floor(uv/stp)*stp; + col = mix(rdr(uv), col, 1.-sat(length(uv*2.))*sat(abs(uv.y*3.))); + col += (1.-sat(length(uv*2.)))*vec3(.1,.2,.3)*5.*(sat((abs(sin((uv.x+uv.y)*5.+fGlobalTime))-.95)*400.)); + out_color = vec4(col, 1.); +} \ No newline at end of file diff --git a/2021-05-21/Readme.md b/2021-05-21/Readme.md new file mode 100644 index 0000000..552ef01 --- /dev/null +++ b/2021-05-21/Readme.md @@ -0,0 +1,31 @@ +# Performances + +On May 21, 2021 as part of [Shadow Demoparty](http://shadow-party.org/). Pre-Recorded by diffty / Cookie Collective + +## Shader Jam - 1 + +Vod : https://www.youtube.com/watch?v=U4T7HCQekUA + +- lamogui +- Nusan +- ponk + +### Audio + +- Lime + +## Shader Jam - 2 + +Vod : https://www.youtube.com/watch?v=Rw5Q_laxWZA + +- evvvvil +- totetmatt +- z0rg + +### Audio + +- LDream + +# Software + +- [Bonzomatic](https://github.com/TheNuSan/Bonzomatic/)