mirror of
https://github.com/CookieCollective/Live-Coding-Sources.git
synced 2025-02-08 05:50:07 +01:00
Shadow Demoparty Jams
This commit is contained in:
parent
6f00934e7a
commit
f4836b9a0b
177
2021-05-21/01_shadow_nusan.glsl
Normal file
177
2021-05-21/01_shadow_nusan.glsl
Normal file
@ -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(dd2<dd) {
|
||||
id=1;
|
||||
dd=dd2;
|
||||
}
|
||||
if(dd3<dd) {
|
||||
id=2;
|
||||
dd=dd3;
|
||||
}
|
||||
|
||||
//pu += vec3(1,.9,.4)*0.1*curve(time,.4)/(0.01+abs(max(length(p1.xy)-.15,d-a1-.5)));
|
||||
|
||||
return dd * .8;
|
||||
}
|
||||
|
||||
void cam(inout vec3 p) {
|
||||
float t=time*(rnd(caid+.24)-.5) + rnd(caid)*247.514;
|
||||
p.yz *= rot(sin(t*.7)*.4-.6);
|
||||
p.xz *= rot(t);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
caid = floor(time/4) + floor(time/5);
|
||||
ca = max(fract(time/4), fract(time/5));
|
||||
|
||||
uv.y -= curve(time+smoothstep(0.7,1.,ca)*rnd(floor(uv.y*50)), .2)*.05;
|
||||
|
||||
|
||||
uv *= 1+curve(time-length(uv),.2)*.2;
|
||||
|
||||
float fov = .5 + rnd(caid+.1);
|
||||
|
||||
vec3 s=vec3((rnd(caid+.3)-.5)*20,(rnd(caid+.4)-.5)*10,-10 - rnd(caid+.2)*10);
|
||||
vec3 r=normalize(vec3(uv, fov));
|
||||
|
||||
cam(s);
|
||||
cam(r);
|
||||
|
||||
vec3 col=vec3(0);
|
||||
|
||||
vec3 p=s;
|
||||
float atm=0;
|
||||
for(int i=0; i<100; ++i) {
|
||||
float d=map(p);
|
||||
if(d<0.001) { break; }
|
||||
if(d>100.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);
|
||||
}
|
109
2021-05-21/01_shadow_ponk.glsl
Normal file
109
2021-05-21/01_shadow_ponk.glsl
Normal file
@ -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);
|
||||
}
|
||||
|
179
2021-05-21/02_shadow_evvvvil.glsl
Normal file
179
2021-05-21/02_shadow_evvvvil.glsl
Normal file
@ -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.x<h.x?t:h;
|
||||
h=vec2(bo(p,vec3(2,10,2)-gr.x+gr.y-gr.z),3); //BLACK BOX INSIDE
|
||||
h.x=abs(abs(h.x)-.2)-.1;
|
||||
|
||||
h.x=max(h.x,abs(p.y)-3.5-ffBass);
|
||||
pp=p;
|
||||
pp.y=mod(pp.y+tt*2+ffHigh*5,5)-2.5;
|
||||
float cyl=cy(pp,vec3(1.5-cos(p.y*.1)*1.5,1.5,1.2));
|
||||
cyl=max(cyl,-(abs(pp.y)-.1));
|
||||
vec3 rp=pp;
|
||||
rp.xz*=r2(tt);
|
||||
cyl=max(cyl,-(abs(rp.z)-.2));
|
||||
h.x=min(h.x,cyl); //BKLACK CYLINDER VERTICAL
|
||||
|
||||
h.x*=0.7;
|
||||
t=t.x<h.x?t:h;
|
||||
t.x*=0.8;
|
||||
|
||||
h=vec2(cy(pp,vec3(1.5-cos(p.y*.1)*1.2,1.,.2)),6); //GLOW CYLINDER VERTICAL
|
||||
//h.x=min(h.x,cx(op,vec3(2+ffHigh*4,.5,.5)));
|
||||
g+=0.1/(0.1*h.x*h.x*(400-390*cos(p.y*.2+ffHigh*4+1.5)));
|
||||
|
||||
t=t.x<h.x?t:h;
|
||||
//h=vec2(ext(p,b2d(p.xz,vec2(1,2)),2),6);
|
||||
|
||||
//t.x=max(t.x,-(length(p-ro)-3));//sphere cut
|
||||
return t;
|
||||
}
|
||||
|
||||
vec2 tr( vec3 ro, vec3 rd )
|
||||
{
|
||||
vec2 h,t=vec2(.1);
|
||||
for(int i=0;i<128;i++){
|
||||
h=mp(ro+rd*t.x,1); if(h.x<.0001||t.x>120) 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)<t||t==0.) co+=1.6*pow(max(dot(normalize(lp-ro),rd),0.),150.);
|
||||
co=mix(co,co.xzy,length(uv)*.75);
|
||||
out_color = vec4(pow(co,vec3(.45)),1);
|
||||
}
|
140
2021-05-21/02_shadow_totetmatt.glsl
Normal file
140
2021-05-21/02_shadow_totetmatt.glsl
Normal file
@ -0,0 +1,140 @@
|
||||
#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
|
||||
mat2 rot(float a){float c=cos(a),s=sin(a);return mat2(c,-s,s,c);}
|
||||
|
||||
float box(vec3 p,vec3 b){
|
||||
vec3 q= abs(p)-b;
|
||||
return length(max(vec3(0.),q))+min(0.,max(q.x,max(q.y,q.z)));
|
||||
}
|
||||
vec2 sdf(vec3 p){
|
||||
vec3 op = p;
|
||||
float bt = texture(texFFTIntegrated,.33).r*.2;
|
||||
vec2 l = vec2(atan(p.z,abs(p.x)),p.y);
|
||||
p += vec3(5,2.,-2.0);
|
||||
p.xy *= rot(-.785*sin(floor(bt)));
|
||||
|
||||
float tt = texture(texNoise,p.xy*.1+bt).r;
|
||||
|
||||
|
||||
float ttt = texture(texFFT,atan(p.x,p.z)+tt*4+fGlobalTime).r;
|
||||
tt = floor(tt*100)/100;
|
||||
ttt = sqrt(ttt);
|
||||
vec2 h;
|
||||
|
||||
h.x = length(p)-5.-tt;
|
||||
h.y = 1.-(ttt);
|
||||
|
||||
vec2 t;
|
||||
|
||||
op.x -=2.;
|
||||
|
||||
op.z = mod(op.z,5)-2.5;
|
||||
|
||||
op.y +=sin(op.z*5+bt*10);
|
||||
|
||||
op.xy *=rot(floor(fGlobalTime+bt*20));
|
||||
op.xz *=rot(floor(bt*20)*1.33);
|
||||
|
||||
|
||||
t.x = box(op,vec3(.9));
|
||||
t.y = 2.;
|
||||
|
||||
h = t.x < h.x ? t:h;
|
||||
|
||||
return h;
|
||||
}
|
||||
vec2 nv=vec2(-.001,.001);
|
||||
#define q(s) s*sdf(p+s).x
|
||||
vec3 norm(vec3 p){return normalize(q(nv.xyy)+q(nv.yyx)+q(nv.yxy)+q(nv.xxx));}
|
||||
|
||||
vec3 pal(float t){return .5+.5*cos(6.28*(1.*t+vec3(.0,.3,.7)));}
|
||||
// Art of code <3
|
||||
float h21(vec2 p) {
|
||||
vec3 a = fract(vec3(p.xyx) * vec3(213.897, 653.453, 253.098));
|
||||
a += dot(a, a.yzx + 79.76);
|
||||
return fract((a.x + a.y) * a.z);
|
||||
}
|
||||
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 puv = uv;
|
||||
|
||||
|
||||
vec3 ro=vec3(.0,.0,-5.),rd=normalize(vec3(uv,1.)),rp=ro;
|
||||
vec3 light = vec3(1.,2.,-3.);
|
||||
|
||||
float bt = texture(texFFT,.2).r;
|
||||
|
||||
float tt = texture(texFFT,floor(abs(uv.x)*100)/100).r;
|
||||
tt =sqrt(tt)*3;
|
||||
|
||||
vec3 col= vec3(tt)*sqrt(pal(tt));
|
||||
vec3 acc = vec3(0.);
|
||||
|
||||
for(float i=0.;i<=69.;i++){
|
||||
vec2 d = sdf(rp);
|
||||
|
||||
if(d.y <=.92+sin(fGlobalTime)*.04){
|
||||
acc += pal(d.y*1.2+fGlobalTime*.1)*max(0.,exp(10*-abs(d.x))/(25.-d.y*20))*exp(-abs(i/20));
|
||||
d.x = max(0.01,abs(d.x));
|
||||
}
|
||||
if(d.y == 2.) {
|
||||
|
||||
acc += vec3(.1,.8,.4)*max(0.,exp(1*-abs(d.x))/(69.-bt*8000.));
|
||||
d.x = max(0.1,abs(d.x));
|
||||
}
|
||||
|
||||
rp +=rd*d.x;
|
||||
if(d.x <=.001){
|
||||
vec3 n = norm(rp);
|
||||
float fre = pow(1.-dot(-rd,n),5.);
|
||||
if(d.y <=1.){
|
||||
|
||||
col = fre*vec3(.1,.5,.8)+vec3(.3)*max(0.,dot(n,normalize(light-rp)));
|
||||
break; // CA ME TURA UN JOUR CET OUBLIE
|
||||
|
||||
} else {
|
||||
//col = vec3(1.3)*max(0.,dot(n,normalize(light-rp)));
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// puv = (puv * vec2(v2Resolution.y / v2Resolution.x, 1))+.5;
|
||||
|
||||
vec2 puvr = (puv*vec2(1.1) * vec2(v2Resolution.y / v2Resolution.x, 1))+.5;
|
||||
vec2 puvg = (puv *vec2(1)* vec2(v2Resolution.y / v2Resolution.x, 1))+.5;
|
||||
vec2 puvb = (puv*vec2(.9) * vec2(v2Resolution.y / v2Resolution.x, 1))+.5;
|
||||
vec3 pcol =vec3(texture(texPreviousFrame,puvr).r,
|
||||
texture(texPreviousFrame,puvg).g,
|
||||
texture(texPreviousFrame,puvb).b
|
||||
);
|
||||
|
||||
|
||||
|
||||
col = mix(col,pcol,.5+fract(fGlobalTime*4)*.4);
|
||||
col+=acc;
|
||||
out_color = vec4(col,1.);
|
||||
}
|
160
2021-05-21/02_shadow_z0rg.glsl
Normal file
160
2021-05-21/02_shadow_z0rg.glsl
Normal file
@ -0,0 +1,160 @@
|
||||
#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 sat(a) clamp(a, 0., 1.)
|
||||
|
||||
mat2 r2d(float a) { float c = cos(a); float s = sin(a); return mat2(c, -s, s, c); }
|
||||
|
||||
vec3 getCam(vec3 rd, vec2 uv)
|
||||
{
|
||||
float fov = 1.;
|
||||
vec3 r = normalize(cross(rd, vec3(0.,1.,0.)));
|
||||
vec3 u = normalize(cross(rd, r));
|
||||
return normalize(rd+(r*uv.x+u*uv.y)*fov);
|
||||
}
|
||||
|
||||
vec2 _min(vec2 a, vec2 b)
|
||||
{
|
||||
if (a.x < b.x)
|
||||
return a;
|
||||
return b;
|
||||
}
|
||||
|
||||
float _cube(vec3 p, vec3 s)
|
||||
{
|
||||
vec3 l = abs(p)-s;
|
||||
l.xz *= r2d(fGlobalTime*.1);
|
||||
l+= vec3(.5,0.1,0.);
|
||||
l.xy *= r2d(fGlobalTime*.1+sin(p.x));
|
||||
l = abs(l)-.5;
|
||||
|
||||
|
||||
return max(l.x, max(l.y, l.z));
|
||||
}
|
||||
|
||||
vec3 accCol;
|
||||
|
||||
vec2 map(vec3 p)
|
||||
{
|
||||
p.xy *= r2d(fGlobalTime*.25);
|
||||
p.xz *= r2d(fGlobalTime*.25);
|
||||
float acc = 1000.;
|
||||
|
||||
for (int i = 0; i < 16; ++i)
|
||||
{
|
||||
float fi = float(i)*.25;
|
||||
vec3 pc = p;
|
||||
float r = 5.;
|
||||
pc.x += sin(fGlobalTime*.25+fi*3.3)*r;
|
||||
pc.y += cos(fGlobalTime*.5+fi*2.)*r;
|
||||
pc.z += abs(sin(fGlobalTime*.1+fi*2.));
|
||||
pc.xy *= r2d(fGlobalTime+fi);
|
||||
pc.xz *= r2d(fGlobalTime*.5+fi*2.);
|
||||
acc = min(acc, _cube(pc, fi+vec3(5.5)*sin(fi+fGlobalTime)));
|
||||
}
|
||||
vec2 main = vec2(_cube(p, vec3(.5)),0.);
|
||||
return _min(main, vec2(acc, 1.));
|
||||
}
|
||||
|
||||
vec3 getNorm(float d, vec3 p)
|
||||
{
|
||||
//return normalize(cross(dFdx(p), dFdy(p)));
|
||||
vec2 e = vec2(0.01,0.);
|
||||
return normalize(vec3(d)-vec3(map(p-e.xyy).x, map(p-e.yxy).x, map(p-e.yyx).x));
|
||||
}
|
||||
|
||||
vec3 trace(vec3 ro, vec3 rd, int steps)
|
||||
{
|
||||
accCol = vec3(0.);
|
||||
vec3 p = ro;
|
||||
for (int i = 0; i < steps; ++i)
|
||||
{
|
||||
float fi = float(i);
|
||||
vec2 res = map(p);
|
||||
if (res.x < 0.01)
|
||||
{
|
||||
return vec3(res.x, distance(p, ro), res.y);
|
||||
}
|
||||
|
||||
vec3 rgb = vec3(1.);
|
||||
if (res.y == 1.)
|
||||
rgb = vec3(1.,.5,.25);
|
||||
accCol += rgb*(rd+.5)*vec3(sin(fi)*.5+.5, cos(fi)*.5+.5,.5)*pow(1.-sat(res.x/0.75),2.)*.15;
|
||||
|
||||
p += rd * res.x;
|
||||
}
|
||||
return vec3(-1.);
|
||||
}
|
||||
|
||||
vec3 rdr(vec2 uv)
|
||||
{
|
||||
|
||||
|
||||
vec3 ro = vec3(sin(fGlobalTime*.25),5.*sin(fGlobalTime),-15.*cos(fGlobalTime));
|
||||
vec3 ta = vec3(0.,0.,0.);
|
||||
vec3 rd = normalize(ta-ro);
|
||||
vec3 col = pow(texture(texNoise, uv*5.).x, 9.)*vec3(150.)+mix(vec3(.5,.5,.6)*.25, vec3(.95,.56,.34), (1.-sat(abs(uv.y*5.)))*sat(length(uv)));
|
||||
rd = getCam(rd, uv);
|
||||
vec3 res = trace(ro, rd, 32);
|
||||
if (res.y > 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.);
|
||||
}
|
31
2021-05-21/Readme.md
Normal file
31
2021-05-21/Readme.md
Normal file
@ -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/)
|
Loading…
Reference in New Issue
Block a user