upload live stream sessions

This commit is contained in:
Leon
2020-04-02 00:18:54 +02:00
parent b422d99685
commit 125db09c1d
21 changed files with 1742 additions and 0 deletions

111
2020-03-19/Flopine.glsl Normal file
View File

@ -0,0 +1,111 @@
#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 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 PI 3.141592
#define TAU (2.*PI)
#define time fGlobalTime
mat2 rot (float a)
{return mat2 (cos(a),sin(a),-sin(a),cos(a));}
void mo (inout vec2 p, vec2 d)
{
p = abs(p)-d;
if (p.y>p.x) p = p.yx;
}
void moda (inout vec2 p, float rep)
{
float per = TAU/rep;
float a = atan(p.y,p.x);
float l = length(p);
a = mod(a,per)-per*0.5;
p = vec2(cos(a),sin(a))*l;
}
float prim1 (vec3 p,float size)
{
p *= size;
p.yz *= rot(time);
//p.xz *= rot(time);
float c = length(p.xz) -1.;
mo(p.xz,vec2(0.9));
moda(p.xz, 3.);
mo(p.yz,vec2(0.2));
moda(p.xy, 8.);
mo(p.xy,vec2(0.1));
return max(-c,dot(p,normalize(vec3(0.5,.5,3.)))) / (size);
}
float fractal (vec3 p)
{
float s = 1.;
float d = prim1(p,s);
for (int i=1; i<4; i++)
{
float ratio =float( i)/3.;
s -= 0.3;
p.xz *= rot(time*ratio);
d = min(d, prim1(p,s));
}
return d;
}
float g1 = 0.;
float SDF (vec3 p)
{
float sphe = length(p)-(2.+texture(texNoise, p.xy*5).x);
g1 += 0.01/(0.01+sphe*sphe);
return max(-(length(p+vec3(0.,0.,12.))-3.),min(sphe,fractal(p)));
}
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 ro = vec3(0.001,0.001,-12.),
rd = normalize(vec3(uv,1.)),
col = vec3(0.),
p = ro;
float shad = 0.;
bool hit = false;
for (float i=0.; i<64.; i++)
{
float d = SDF(p);
if (d<0.001)
{
hit = true;
shad = i/64.;
break;
}
p += d*rd*0.8;
}
if (hit)
{
col = vec3(1.-shad);
col += g1*vec3(.8,.1,0.9)*0.7;
}
out_color = vec4(sqrt(col),1.);
}

8
2020-03-19/Readme.md Normal file
View File

@ -0,0 +1,8 @@
# Performances
On March 19th, 2020 on [Cookie Live Stream](https://www.twitch.tv/videos/570598632).
## Software
- [Bonzomatic](https://github.com/TheNuSan/Bonzomatic/)
- [TidalCycles](https://tidalcycles.org/)

100
2020-03-19/Sixclones.glsl Normal file
View File

@ -0,0 +1,100 @@
#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 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 P 3.14159
#define TP 2.0 * P
#define HP 0.5 * P
#define QP 0.25 * P
#define t fGlobalTime
#define ht 0.5 * t
#define tt 0.1 * t
#define S(a, b, t) smoothstep(a, b, t)
float map01(float n, float stop2, float start2) {
return (0.5 * n + 0.5) * stop2 + start2;
}
float circleSDF(vec2 uv) {
return length(uv);
}
float rectSDF(vec2 uv, vec2 s) {
return max(abs(uv.x / s.x), abs(uv.y / s.y));
}
vec2 rotate2d(vec2 uv, float a) {
return uv * mat2(cos(a), sin(-a), cos(a), sin(a));
}
float fill(float x, float s) {
return 1.0 - step(s, x);
}
float fill(float x, float s, float p) {
p *= 0.01;
return 1.0 - S(s - p, s + p, x);
}
float stroke(float x, float s, float w, float p) {
p *= 0.01;
return clamp(
S(s - p, s + p, x - 0.5 * w) * S(s + p, s - p, x + 0.5 * w),
0.0, 1.0
);
}
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);
float n = 8.0;
vec2 gv = fract(n * uv);
vec2 id = floor(n * uv);
vec3 color = vec3(0.0);
float offset = mix(
map01(sin(-t + P * gv.x - cos(ht + P * id.x) - sin(P * gv.y)), QP, HP),
map01(cos(t + TP * gv.x), 0.0, TP),
step(0.5, mod(ht, 2.0))
);
float np = map01(
sin(t + P * uv.x + sin(-t + TP * uv.y) + P * gv.x + offset),
6.0, 10.0 * uv.x + 4.0 + mod(ht, 0.5));
vec2 size = vec2(
map01(cos(t + P * uv.x + 0.5 * sin(t + TP * id.x)), 0.5, 2.0),
map01(sin(t - QP * uv.y + cos(-ht + TP * (uv.x + uv.y))), 0.5, 2.0)
);
float rect = rectSDF(rotate2d(uv, ht + cos(t + P * uv.x)), size);
vec3 pre = vec3(
0.0,
map01(cos(t), 15.0, 20.0),
map01(sin(t), 15.0, 20.0)
);
float circ = circleSDF(uv);
float circf = fill(circ, map01(sin(t + P * uv.x + sin(-t + 5.0 * P * uv.y) + cos(t + P * (id.x - 0.5))), 0.25, 0.75));
color.r += fill(fract(-t + np * rect), 0.5, 10.0*cos(t + P * gv.x) + 15.0);
color.g += fill(fract(-t + np * rect), 0.5, 10.0*sin(t + TP * gv.y + sin(-t)) + pre.y);
color.b += fill(fract(-t + np * rect), 0.5, 10.0*sin(t + cos(-t + TP * uv.x)) + pre.z);
color *= circf;
out_color = vec4(color, 1.0);
}

132
2020-03-19/alkama.glsl Normal file
View File

@ -0,0 +1,132 @@
#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 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
const float pi = acos(-1);
float tt = .4*mod(fGlobalTime, pi*100.);
float rt = floor(tt);
float ft = fract(tt);
float t = rt + ft*ft;
mat2 rot(float a) { float c=cos(a), s=sin(a); return mat2(c,s,-s, c); }
float torus(vec3 p, float r, float s) { vec2 b=vec2(length(p.xy)-r, p.z); return length(b)-s; }
vec2 moda(vec2 p, float r) {
r = 2*pi/r;
float a = mod(atan(p.y, p.x), r) - r*.5;
return vec2(cos(a), sin(a))*length(p);
}
float glowAccumulator = 0;
float scene(vec3 p) {
vec3 po = p;
p.y = mod(p.y+t, 2.)-1.;
p.xz *= rot(tt);
p.xz = moda(p.xz, 4. + (mod(tt*2, 5)));
p.yz = moda(p.yz, 4. + (mod(tt*2, 7)));
float tr = torus(p, 2.+.5*sin(tt), .01);
float pl = dot(abs(p), vec3(0, .4, 1.))-.1;
float o = max(tr, pl)-.2;
// lets make it glow even more :D
po.y -= sin(10*t+po.y);
po.xz += .2*sin(2*t+po.y);
float glo = length(po.xz)-.2;
po = p;
po.y += .05*sin(10*t+po.x*po.z);
glo = min(glo, length(po.yz))-.01;
glowAccumulator+= .03/(.01+abs(glo));
return min(o, max(glo, .01));
}
vec3 getCamera(vec2 pixelCoord, vec3 origin, vec3 target, float zoom) {
vec3 forward = normalize(target-origin);
vec3 side = normalize(cross(vec3(0,1,0), forward));
vec3 up = normalize(cross(forward, side));
return normalize(forward*zoom+pixelCoord.x*side+pixelCoord.y*up);
}
vec3 calculateNormalUsingGradientsAt(vec3 p) {
vec2 eps = vec2(0, .001);
return normalize(vec3(scene(p) - vec3(scene(p-eps.yxx), scene(p-eps.xyx), scene(p-eps.xxy))));
}
#define fakeAmbiantOcclusion(a) clamp(scene(hitPoint+normalAtHitpoint*a)/a, 0., 1.)
#define fakeSubSurfaceScattering(a) smoothstep(0., 1., scene(hitPoint+lightDirection*a)/a)
void main(void)
{
vec2 currentPixelCoord = (gl_FragCoord.xy / v2Resolution.xy - .5) * vec2(v2Resolution.x/v2Resolution.y, 1);
vec3 eye = (15+5*cos(t+sin(t))) * vec3(0, 0, .5);
vec3 target = vec3(0);
target.xz += vec2(sin(t), cos(t));
target.y += 6*sin(t);
float idx = mod(floor(tt*5), 11);
if(idx == 0) {
currentPixelCoord.x = abs(currentPixelCoord.x);
}
if(idx == 1) {
currentPixelCoord = abs(currentPixelCoord);
}
if(idx > 2 || idx < 6) {
currentPixelCoord *= 1. - length(currentPixelCoord)*.7;
}
if(idx > 6) {
currentPixelCoord /= 1. - length(currentPixelCoord)*.10;
}
vec3 rayDirection = getCamera(currentPixelCoord, eye, target, .8);
float clouds = texture(texNoise, .7*abs(vec2(atan(rayDirection.y, rayDirection.z), rayDirection.x))).r;
vec3 color = vec3(pow(1.8*clouds, 4));
vec3 lightPosition = 10*vec3(1,1,-1);
float hitDistance = 0;
vec3 hitPoint = eye; // < start from eye position
int i = 0;
for(i=0; i<300; i++) {
float closestHit = scene(hitPoint)*.7;
if(abs(closestHit)<.001) {
vec3 normalAtHitpoint = calculateNormalUsingGradientsAt(hitPoint);
vec3 lightDirection = normalize(lightPosition-hitPoint);
float diffuse = max(0, dot(normalAtHitpoint, lightDirection));
float specular = pow(max(0, dot(rayDirection, reflect(lightDirection, normalAtHitpoint))), 50);
color = vec3(diffuse)*fakeSubSurfaceScattering(.4);
color *= .2+.2*(fakeAmbiantOcclusion(.1)+fakeAmbiantOcclusion(.3));
color += vec3(specular);
break;
}
if(hitDistance>100.) break;
hitDistance += closestHit;
hitPoint += rayDirection * closestHit;
}
color += vec3(1.4, .1, .5)*pow(i * .007, .9);
color += vec3(.0002+.0001*sin(t*10))*pow(glowAccumulator, 3)*normalize(acos(-rayDirection));
out_color = vec4(color, 1);
}

96
2020-03-19/anton.glsl Normal file
View File

@ -0,0 +1,96 @@
#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 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 iTime fGlobalTime
#define REP(p, r) (mod(p + r * .5, r) - r * .5)
mat2 rotation(float angle)
{
float cosA = cos(angle); float sinA = sin(angle);
return mat2(cosA, -sinA, sinA, cosA);
}
float map(vec3 position)
{
vec3 cp = position;
position.xz *= rotation(iTime * .1 + position.y *.0125);
position.z -=iTime * 2.;
position = REP(position, 15.);
float distan = length(position) - 2.;
position = cp;
distan = max(distan, -length(position.xy) + (1. + sin(position.z - iTime) * .5));
return distan;
}
vec3 norm(vec3 p)
{
vec2 e = vec2(.01,.0);
float v = map(p);
return normalize(vec3(v - map(p + e.xyy),
v - map(p + e.yxy),
v - map(p + e.yyx)));
}
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 ro = vec3(0.,0.,-10.);
vec3 cp = ro;
vec3 rd = normalize(vec3(uv, 1.));
float cd = 0., st = 0., di = 0.;
for(;st < 1.; st += 1. / 128.)
{
cd = map(cp);
if(abs(cd) < .01 || cd > 10.)
{
break;
}
cp += rd * cd;
di += cd;
}
out_color = vec4(0.);
if(cd < .01)
{
vec3 normal = norm(cp);
out_color = vec4(normal, 0.) * di;
cp *= .01;
out_color.rg *= rotation(cp.y + iTime);
out_color.gb *= rotation(cp.z + iTime * .5);
out_color.br *= rotation(cp.x + iTime * .25);
out_color *= exp(-di * .0125);
out_color = sqrt(out_color);
}
}

29
2020-03-19/bruce.glsl Normal file
View File

@ -0,0 +1,29 @@
#version 410 core
uniform float fGlobalTime;
uniform vec2 v2Resolution;
uniform sampler1D texFFT;
uniform sampler2D texNoise;
uniform sampler2D texTex1;
layout(location = 0) out vec4 out_color;
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 m;
m.x = atan(uv.x / uv.y) / 3.14;
vec4 fromage = texture(texNoise, uv-m+sin(fGlobalTime)+0.5);
float raclette = uv.x ;
uv += pow(length(uv), raclette* fromage.x);
m.y = 1 / length(uv) * .2;
float r = sqrt(dot(uv,uv));
float w = (sin(fGlobalTime)+ 3.0*cos(fGlobalTime + 15.0*m.y)/2.0);
float col = 0.0;
float d = pow(dot(uv,uv),12.*cos(fGlobalTime)+0.975);
col = .1/length(mod(uv, 1.0)-sin(fGlobalTime*d*w*m)+0.41);
float coscoscos = cos(d) + cos(m.x) + cos(fromage.r);
col += smoothstep(-2., 2., d-fromage.g+mod(uv,2.0).r * coscoscos);
float camembert = fromage.r * m.y+r * abs(sin(uv.x));
out_color = vec4(camembert, fromage.r, col,1.0)*vec4(0.5,camembert,0.9,1.0);
}

39
2020-03-19/cookie.glsl Normal file
View File

@ -0,0 +1,39 @@
#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 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
mat2 rot (float a) { float c=cos(a),s=sin(a); return mat2(c,-s,s,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);
uv.y *= -1.0;
float d = length(uv);
uv *= 2. + 0.2 * sin(time + d*4.);
uv *= rot(sin(time*2.-d*2.)*.2);
uv += 0.5;
vec4 color = texture(cookie, uv);
color.rgb = mix(vec3(0), vec3(1), color.a);
out_color = color;
}

109
2020-03-19/evvvvil.glsl Normal file
View File

@ -0,0 +1,109 @@
#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 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
vec2 s,v,e=vec2(.00035,-.00035);float t,tt,b,bb,g,g2;vec3 np,bp,pp,po,no,al,ld;
float bo(vec3 p, vec3 r){p=abs(p)-r;return(max(max(p.x,p.y),p.z));}
mat2 r2 (float r){ return mat2(cos(r),sin(r),-sin(r),cos(r));}
vec4 c=vec4(0,5,15,.2);
vec2 fb( vec3 p )
{
vec2 h,t=vec2(bo(p,vec3(2,5,1)),5);
t.x=abs(t.x)-.2;
t.x=max(t.x,p.z-0.3);
h=vec2(bo(p,vec3(2,5,1)),6);
h.x=abs(h.x)-.1;
h.x=max(h.x,p.z-0.6);
t=t.x<h.x?t:h;
t.x=max(t.x,-bo(p,vec3(1.5,4.5,5)));
h=vec2(length(abs(p)-vec3(0,2.5,0))-1.5,5);
t=t.x<h.x?t:h;
h=vec2(length(abs(p.xy)-vec2(0,2.5))-.1,3);
t=t.x<h.x?t:h;
h=vec2(length(abs(p.xy)-vec2(2,2))-.02,6);
g+=0.1/(0.1+h.x*h.x*40);
t=t.x<h.x?t:h;
t.x*=0.7;
return t;
}
vec2 mp( vec3 p )
{
p.xy*=r2(sin(p.z*.2)*.3);
np=p;
np.z=mod(np.z+tt*3,10)-5;
for(int i=0;i<4;i++){
np=abs(np)-vec3(4,2.,0);
np.xy*=r2(.785/2);
np.xz*=r2(-.05);
}
vec2 h,t=fb(np);
h=vec2(length(abs(p.xy)-vec2(4,2))-.1,6);
g2+=0.1/(0.1+h.x*h.x*(40-sin(p.z*.4+tt*2.)*39.8));
t=t.x<h.x?t:h;
h=vec2(length(cos(p+np*.2-vec3(0,tt,0)))-.01,6);
g2+=0.1/(0.1+h.x*h.x*400);
t=t.x<h.x?t:h;
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);
if(h.x<.0001||t.x>100) break;
t.x+=h.x;t.y=h.y;
}
if(t.x>100) t.y=0;
return t;
}
#define a(d) clamp(mp(po+no*d).x/d,0.,1.)
#define s(d) smoothstep(0.,1.,mp(po+ld*d).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);
//float f = texture( texFFT, d ).r * 100;
tt=mod(fGlobalTime,62.83);
vec3 ro=mix(vec3(1),vec3(-1,-1,1),ceil(sin(tt*.4)))*vec3(cos(tt*.2)*3,5,-20.),
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;
co=fo=vec3(.1)-length(uv)*.1;
ld=normalize(vec3(.2,.3,-.4));
s=tr(ro,rd);t=s.x;
if(s.y>0){
po=ro+rd*t;
no=normalize(e.xyy*mp(po+e.xyy).x+
e.yyx*mp(po+e.yyx).x+
e.yxy*mp(po+e.yxy).x+
e.xxx*mp(po+e.xxx).x);al=vec3(.1,.2,.4);
if(s.y<5) al=vec3(0);
if(s.y>5) al=vec3(1);
float 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(.4)+.2)*(dif+s(2)+s(4)),fo,min(fr,.5));
co=mix(fo,co,exp(-.0001*t*t*t));
}
out_color = vec4(pow(co+g*.2+g2*vec3(.1,.2,.4)*.2,vec3(.45)),1);
}

66
2020-03-19/lamogui.glsl Normal file
View File

@ -0,0 +1,66 @@
#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 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 r(float a ){
float c = cos(a);
float s = sin(a);
return mat2(c, s, -s, c);
}
float map(vec3 p) {
vec3 g = p;
g.xy = r(p.z*0.1) * g.xy;
vec3 prout = g;
float d = cos(g.x) + cos(g.y) + cos(g.z);
float s = 10.0;
g *= s;
d = max(d, (cos(g.x) + cos(g.y) + cos(g.z) ) /s);
d = min(d, p.y + 0.2 - 0.1 * texture(texNoise, p.xz).r - 0.1 * cos(fGlobalTime + 2.0*p.z + 2.632 * p.x));
return min(d, prout.y + 1.0 + 0.7 *texture(texNoise, p.xz * 0.2).r - 0.1 * cos(fGlobalTime + 2.0*prout.z + 2.632 * prout.x));
}
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);
float v = cos(fGlobalTime*3.0);
vec3 ro = vec3(0.0,0.2 * abs(v),fGlobalTime);
vec3 rd = normalize(vec3(uv, 0.7 - length(uv)));
vec3 p = ro;
float st = 1.0;
for ( float i = 0.; i< 127.; ++i) {
float d = map(p);
if (abs(d) < 0.01) {
st = i / 127.0;
break;
}
p += rd * d;
}
uv = uv *0.8+ 0.2* r(fGlobalTime * 10.0) * uv;
vec3 color = vec3((uv +0.5) * (st), 0.1) * (1.0) + (vec3(uv, 0.1) * exp( -0.1 * distance(p,ro))) + (vec3(uv, 0.1) * (1.0 -exp( -0.1 * distance(p,ro))));
out_color = vec4(color, 0.0);
}

122
2020-03-19/nusan.glsl Normal file
View File

@ -0,0 +1,122 @@
#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 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
float time = fGlobalTime;
mat2 rot(float a) {
float ca=cos(a);
float sa=sin(a);
return mat2(ca,sa,-sa,ca);
}
float box(vec3 p, vec3 s) {
p=abs(p)-s;
return max(p.x, max(p.y,p.z));
}
float rnd(float t) {
return fract(sin(t*421.522)*742.512);
}
float curve(float t, float d) {
t/=d;
return mix(rnd(floor(t)), rnd(floor(t)+1), pow(smoothstep(0,1,fract(t)),10));
}
vec3 fractal(vec3 p, float t1) {
p.xz *= rot(sin(p.y*0.2+time)*0.5);
p.yz *= rot(sin(p.x*0.3+time*1.3)*1.5);
for(int i=0; i<7; ++i){
float t=i + t1*0.1 + curve(t1,0.4)*0.5 + p.x*(0.1+sin(curve(t1,0.2)+t1*0.3)*0.2);
p.xz *= rot(t);
p.xy *= rot(t*0.7);
p.xz = abs(p.xz) - vec2(3,3)*(0.2+i*0.1)*0.7;
}
return p;
}
float at1=0;
float at2=0;
float map(vec3 p) {
vec3 p2 = fractal(p+vec3(0,0,0), 12.7+time);
vec3 p3 = fractal(p+vec3(0,2,0), 15.7+time*0.7);
float d=box(p2, vec3(3,2,0.1));
float d2=box(p3, vec3(3,2,0.1));
d=min(d, max(-p.y,length(p.xz)-0.2));
at1 = d;
at2 = d2;
d=min(d,d2);
d=max(d,0.1);
return d;
}
void cam(inout vec3 p) {
float t=time*0.2 + curve(time, 1.7)*3.0;
p.yz *= rot(sin(t*1.3)*0.3+0.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);
uv.x += (curve(time, 0.7)-0.5)*0.5;
vec3 s=vec3(0,0,-30);
float fov = 0.9+curve(time, 0.7);
vec3 r=normalize(vec3(-uv, fov));
cam(s);
cam(r);
vec3 col=vec3(0);
vec3 p=s;
for(int i=0; i<100; ++i) {
float d=map(p);
if(d<0.001) break;
if(d>200.0) break;
p+=r*d;
//col += vec3(0.2,0.4,0.9)*0.01/(0.1+abs(d));
col += vec3(0.2,0.4,0.9)*0.004/(0.1+abs(at1));
col += vec3(0.9,0.3,0.2)*0.004/(0.1+abs(at2));
}
col *= 1.2-length(uv);
out_color = vec4(col,1);
}

105
2020-03-19/ponk.glsl Normal file
View File

@ -0,0 +1,105 @@
#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 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
#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 lookat (vec3 eye, vec3 at, vec2 uv, float fov) {
vec3 forward = normalize(at-eye);
vec3 right = normalize(cross(forward, vec3(0,1,0)));
vec3 up = normalize(cross(right, forward));
return normalize(forward * fov + right * uv.x + up * uv.y);
}
float map (vec3 pos) {
vec3 p0 = pos;
float cell = 6.;
float iz = floor(pos.z/cell);
//pos.z = repeat(pos.z + time, cell);
//pos.xz *= rot(time);
//pos.xy *= rot(time);
float scene = 1.0;
float range = 2.0;// + 1.0 * sin(time);
float a = 1.0;
float falloff = 1.2;
const float count = 7.;
for (float index = count; index > 0.; --index) {
pos.xz *= rot(time*.05/a);
//pos.yz *= rot(sin(time)*0.2);
pos = abs(pos)-range*a;
//scene = min(scene, length(pos)-0.5*a);
scene = min(scene, max(pos.x,max(pos.y,pos.z)));
a /= falloff;
}
scene = max(-scene,0.);
//pos = repeat(pos, .1);
//scene = max(scene, -length(pos.xy)+.05);
//scene = max(scene, -length(p0.xy)+1.0);
pos = p0;
//pos.z = repeat(pos.z + time, cell);
a = 1.0;
float shape = 1.;
for (float index = 4.; index > 0.; --index) {
pos.xz *= rot(time*.2);
pos.yz *= rot(time*2.);
pos.xz = abs(pos.xz)-.3*a;
shape = min(shape, length(pos.xy)-0.2*a);
a /= falloff;
}
//shape = max(shape, length(p0)-.5);
//scene = min(scene, shape);
//scene = max(scene, length(p0)-2.);
return scene;
}
vec3 getNormal (vec3 p) {
vec2 e = vec2(0.001,0);
return normalize(vec3(map(p+e.xyy)-map(p-e.xyy), map(p+e.yxy)-map(p-e.yxy), map(p+e.yyx)-map(p-e.yyx)));
}
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.,-2);
vec3 ray = lookat(eye, vec3(0.,sin(time*.2)*.5,0), uv, .5);
float total = 0.0;
float shade = 0.0;
const float count = 100.;
for (float index = count; index > 0.; --index) {
float dist = map(eye+ray*total);
if (dist < 0.001) {
shade = index/count;
break;
}
dist *= .9;
total += dist;
}
vec3 color = vec3(shade);
vec3 normal = getNormal(eye+ray*total);
color = vec3(.3)*clamp(dot(normal, normalize(vec3(0,1,-1))),0.,1.);
color += vec3(.9)*pow(clamp(dot(normal, -ray),0.,1.), 8.);
color *= shade;
out_color = vec4(color,1);
}

8
2020-03-26/Readme.md Normal file
View File

@ -0,0 +1,8 @@
# Performances
On March 26th, 2020 on [Cookie Live Stream](https://www.twitch.tv/videos/576039130).
## Software
- [Bonzomatic](https://github.com/TheNuSan/Bonzomatic/)
- [TidalCycles](https://tidalcycles.org/)

108
2020-03-26/Wrighter.glsl Normal file
View File

@ -0,0 +1,108 @@
#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 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 sdBox(vec2 p, vec2 s){
p = abs(p) - s;
return max(p.x, p.y);
}
float xor(float x,float y){
return float(int(x)*int(y));
}
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);
//uv.xy *= rot(time*0.00004 + q.y*0.01);
vec3 col = vec3(0);
vec2 p = uv;
#define pal(a,b,c,d,e) (a + b*sin(c*d + e))
#define rot(x) mat2(cos(x),-sin(x),sin(x),cos(x))
float d = 10e7;
vec2 q = vec2(10.*atan(p.x,p.y)/6.28, length(p));
q.y = log(q.y) + time*1.11 + texture(texFFT, 0.1).x*10.5 ;
float id = floor(q.y*10.);
q.xy *= rot(time*0.00004 + q.y*0.0001);
q = sin(q*3.);
q = sin(q*1. + time);
float a = 0.;
for(float i = 0.; i < 20.; i++){
//q = abs(q);
if(q.x < q.y)
q.xy = q.yx;
float m = 100.;
float x = xor(q.y*m,q.x*m);
q.x *= 1. ;
if(mod(x*2., 1.) < 1.){
//float circ = exp(-length(sin(q*1. + time))*20.);
float circ = exp(-length(sin(q*1. + time))*20.);
col += circ * pal(0.5,1.,vec3(0.2,0.3,0.5), 0.7 ,0.4 + id*0.5);
//d = min(d, length(q) - 10.5);
}
q -= 0.15;
q -= 0.5;
if(mod(i,3. ) == 0 && x > 0.4){
d = min(d, sdBox(mod(q,1.) - 0.5, vec2(0.9)));
a += x;
}
else{
d = max(d, -sdBox(mod(q,1.) - 0.5, vec2(0.3)));
a += x;
}
q.xy *= rot(0.125*3.14);
}
col += smoothstep(0.001,0., d);
if(d < 0.001)
col *= pal(0.1,1.,vec3(0.2,0.3,0.5), 0.7 ,0.4 + floor(id)*1. + time);
col = col;
col = max(col, 0.);
out_color += col.xyzy;
}

107
2020-03-26/alkama.glsl Normal file
View File

@ -0,0 +1,107 @@
#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 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
// Hellow from Alkama's Lab
// _ _
// ,,,(O.O),,,
//
#define sat(a) clamp(a, 0., 1.)
#define ao(a) sat(sc(p+n*a)/a)
#define ss(a) smoothstep(0., 1., sc(p+ld*a)/a)
const float pi = acos(-1);
const vec2 e = vec2(.001, 0);
const vec3 ro = vec3(0,2,-8.5);
float tt=mod(.4*fGlobalTime, 40.*pi);
float t = tt;
float torus(vec3 p, float r, float s) {
vec2 b = vec2(length(p.xy)-r, p.z);
return length(b)-s;
}
float box(vec3 p, vec3 s) { vec3 b=abs(p)-s; return max(max(b.x, b.y), b.z); }
mat2 rot(float a) { float c=cos(a),s=sin(a); return mat2(c,s,-s,c); }
vec2 moda(vec2 p, float r) {
r = 2*pi/r;
float a=mod(atan(p.y, p.x), r) -r*.5;
return vec2(cos(a),sin(a))*length(p);
}
float sc(vec3 p) {
vec3 po = p;
float k = t*.1;
p.xz *= rot(sin(cos(k)*pi+k)*pi);
p.xy += .3*sin(t*.5)*sin(p.yz+tt*5);
vec3 off = .1*(2*texture(texNoise, p.xz*.5).xyz-1);
p+=off;
for(int i=0; i<5+floor(mod(tt*.5, 8)); i++) {
p = abs(p);
p.xy *= rot(pi*.1);
p.yz *= rot(pi*.1);
p -= (i+1)*.08+.05*sin(t);
}
p.xz = moda(p.xz, 23.);
p.yz = moda(p.yz, 22.);
float tr= torus(p*.12, 1.23, .13);
p.xz *= rot(-t);
p.xy *= rot(-tt);
float b = box(p, vec3(5., .2+.19*sin(tt), 1));
float camex=length(po+off-ro) - 1.5;
return max(min(b, tr), -camex);
}
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 tg = vec3(1.5*sin(t),0.5*cos(t*2),0);
float z = .7 + .2*sin(tt*2);
vec3 f= normalize(tg-ro);
vec3 s=normalize(cross(vec3(.3*sin(tt),1,0), f));
vec3 u=normalize(cross(f,s));
vec3 rd = f*z+uv.x*s+uv.y*u; // << ohohhoho not normalizing that!
vec3 col = vec3(0);
float d=0;
vec3 p = ro;
for(int i = 0; i<300; i++) {
float h = sc(p);
if(h<.001) {
vec3 n=normalize(vec3(sc(p)-vec3(sc(p-e.xyy), sc(p-e.yxy), sc(p-e.yyx))));
vec3 ld = normalize(20*vec3(1,1,-1) - p);
float fr = sat(pow(max(0., 1.+dot(n,rd)), 2.));
vec3 bg = normalize(acos(sat(rd))*vec3(1.2, .8, 1.5))*(log(d)*i*.004);
vec3 fg = vec3((ao(.1)+ao(.3))*.1 + ss(.2)*.75);
col = fr*mix(fg, bg, fr)+bg;
break;
}
if(d>100.) break;
d+=h;
p+=rd*h;
}
col *= sat(1.3-pow(length(uv), 2.));
out_color = vec4(col, 1.);
}

87
2020-03-26/anton.glsl Normal file
View File

@ -0,0 +1,87 @@
#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 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 REP(p,r) (mod(p + r/2.,r) - r/2.)
#define iTime (fGlobalTime)
mat2 rot(float a)
{
float ca = cos(a); float sa = sin(a);
return mat2(ca,-sa,sa,ca);
}
float map(vec3 p)
{
vec3 cp = p;
float dist = p.y + 1.;
p.xy *= rot(p.z * .01 - iTime * .001);
dist = cos(p.x) + cos(p.y) + cos(p.z);
p = cp;
//p += iTime;
// p = REP(p , 17.);
float cu = max(max(p.x,p.y),p.z);
dist = min(dist, cu);
p = cp;
dist = max(dist, -length(p) + 10.);
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 cp = vec3(0.,5.,-10.);
vec3 rd = normalize(vec3(uv, 1.));
float st = 0.; float cd = 0.; float di = 0.;
for(; st < 1.; st += 1./256.)
{
cd = map(cp);
if(abs(cd) < .01 || cd > 30.)
{
break;
}
cd = min(cd, 1.);
cp.xz *= rot(sin(st * .001 + iTime * .0025));
cp += rd * cd;
cp += normalize(vec3(0.,0.,-5.) - cp) * pow(length(vec3(0.,0.,-5.) - cp), 1. + sin(iTime) * .5) * .001;
di += cd;
}
float f = 1. - st;
out_color = (vec4(sin(di * .02), cos(di * .003 + .2), sin(di+ iTime) , 1.) * .5 + .5) * exp(-di * .05);
out_color = pow(out_color,vec4(.4545));
}

31
2020-03-26/bruce.glsl Normal file
View File

@ -0,0 +1,31 @@
#version 410 core
uniform float fGlobalTime;
uniform vec2 v2Resolution;
uniform sampler1D texFFT;
uniform sampler2D texNoise;
uniform sampler2D texTex1;
layout(location = 0) out vec4 out_color;
#define time fGlobalTime
void main(void)
{
vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y) * 4.0;
uv -= 1.95;// + abs(sin(time)-0.99);
uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
vec3 c = vec3(0.2);
float r = length(uv)*2.0 + (sin(time) -0.5) ;
float a = atan(uv.y, uv.x);
float f = abs(cos (a * 5.));
vec3 col = vec3(0.0);
for(int i=0;i<3;i++) {
uv += length(uv);
col[i] = 0.01/length(abs(mod(uv,1.)-0.24));
}
col = 1.0 - normalize(col*col);
c -= fract(uv.x +time);
c -= vec3( 0.5 - smoothstep(f, f * cos(r*time*0.03), r) );
out_color = vec4( vec3(c.r + col.r,col.g * sin(time)-0.6,c.b + col.b), 1.0);
}

60
2020-03-26/cookie.glsl Normal file
View File

@ -0,0 +1,60 @@
#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 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
mat2 rot (float a) { float c=cos(a),s=sin(a); return mat2(c,-s,s,c); }
float random (in vec2 st) { return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123); }
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
void main(void)
{
vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);
vec2 loduv = v2Resolution.xy/16.0;
uv -= 0.5;
uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
uv.y *= -1.0;
float d = length(uv);
uv *= 1. + 1. * sin(d*2.+2.);// + uv.x*10.);
uv *= rot((pow(sin(time*2.-d*2.)*0.5+0.5, 8.))*2.);
uv += 0.5;
//uv = floor(uv*loduv)/loduv;
vec4 color = texture(cookie, uv);
color.rgb = mix(vec3(0), vec3(1), color.a);
uv = 2.*(gl_FragCoord.xy-0.5*v2Resolution.xy)/v2Resolution.y;
//uv = floor(uv*loduv)/loduv;
d = length(uv);
//uv *= rot(sin(d*2.-time)*.5);
uv.y -= pow(abs(uv.x)*.4,0.1)-.8;
d = length(uv);
float tint = d*.7-time*.2;
//tint += 2.*atan(uv.y,uv.x)/3.14;
float lod = 5.;
tint = ceil(tint*lod)/lod;
float s = step(mod(tint*2., 1.),0.5);
color.rgb = hsv2rgb(vec3(tint, 0.9, color.r));
out_color = color;
}

124
2020-03-26/flopine.glsl Normal file
View File

@ -0,0 +1,124 @@
#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 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 PI 3.141592
#define TAU (2.*PI)
#define time fGlobalTime
#define blipbloop texture(texFFT, 0.01)
void mo (inout vec2 p, vec2 d)
{
p = abs(p)-d;
if(p.y>p.x) p = p.yx;
}
float hash21(vec2 x)
{return fract(sin(dot(x,vec2(12.35,18.5)))*1245.5);}
float cyl (vec3 p, float r, float h)
{return max(length(p.xy)-r,abs(p.z)-h);}
float plane (vec3 p, vec3 n)
{return dot(p,normalize(n));}
float lily (vec3 p)
{
float a = atan(p.z,p.x);
p.y += (mod(a, TAU/5.))*0.15;
return cyl(p.xzy, 3.,0.15);
}
// NO WAS NOT PLANNED
float flower (vec3 p)
{
p.y += sin(length(p.xz*2.)-time*blipbloop.r)*0.3;
mo(p.xz, vec2(.5));
mo(p.xy, vec2(.5));
mo(p.yz, vec2(.3));
return plane(p, vec3(0.5,0.5,1.));
}
float water (vec3 p)
{
p.y += 1.2;
p.y += texture(texNoise, p.xz*0.06+time*0.02).r + texture (texNoise, p.xz*0.05-time*0.01).r;
return abs(p.y)-1.;
}
float li,wat, flo;
float SDF (vec3 p)
{
li = lily(p);
wat = water(p);
flo = flower(p);
return min(li,min(flo,wat));
}
vec3 getcam (vec3 ro, vec3 tar, vec2 uv)
{
vec3 f = normalize(tar-ro);
vec3 l = normalize(cross(vec3(0.,1.,0.),f));
vec3 u = normalize(cross(f,l));
return normalize(f + l*uv.x + u*uv.y);
}
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);
float sither = hash21(uv);
vec3 ro = vec3(0.001,8.,-3.),
p = ro,
tar = vec3(0.),
rd = getcam(ro, tar, uv),
col = vec3(0.);
float d, shad = 0.;
for (float i=0.; i<64.; i++)
{
d = SDF(p);
if (d <0.001)
{
shad = i/64.;
break;
}
d *= 0.9+sither*0.05;
p += d*rd;
}
if (d==wat)
{
col = mix(vec3(0.1,0.2,0.8),vec3(0.7,0.8,0.9),floor((shad)*7.)/7.);
}
if (d==li)
{
col = mix(vec3(0.1,0.5,0.2),vec3(0.7,0.9,0.8),floor((shad)*15)/15);
}
if (d==flo)
{
col = mix(vec3(0.7,0.2,0.8),vec3(0.7,0.7,0.8),floor((shad)*8.)/8.)*0.8;
}
//col = vec3(water(vec3(uv,0.)));
out_color = vec4(sqrt(col),1.);
}

83
2020-03-26/lamogui.glsl Normal file
View File

@ -0,0 +1,83 @@
#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 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);
float s = sin(a);
return mat2(c,-s,s,c);
}
float cube( vec3 p, vec3 b ) {
vec2 uv = p.xy;
float v = 3.0 * texture(texFFT, fract((uv.x * 0.3))).x;
b.x += v;
vec3 q = abs( p) - b;
return length( max(q, 0.0) ) + min(max(q.x, max(q.y, q.z)), 0.0);
}
float qqube( vec3 p ) {
vec3 q = p;
q.y += sin((p.z+fGlobalTime) *0.3 + p.x * 0.2) * 1.5;
q = mod(q, 5.0) - 2.5;
q.xy = rot( fGlobalTime) * q.xy;
q.yz = rot( fGlobalTime) * q.yz;
return cube( q, vec3(1.0));
}
float map(vec3 p) {
float d = qqube(p);
d = max( d,qqube(p*10.0)/10.0 );
return d;
}
vec3 grad(vec3 p ){
vec2 e = vec2(0.01, 0.);
return normalize(vec3(
map(p + e.xyy) - map(p - e.xyy), map(p + e.yxy) - map(p - e.yxy), map(p + e.yyx) - map(p - e.yyx)
));
}
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 ro = vec3(0.0, 0.0, -2.0 + 1.3 * texture(texFFTIntegrated, 0.01).x);
vec3 rd = normalize(vec3(uv, 0.8 - length(uv) - texture(texFFT, 0.01).x) );
vec3 p = ro;
for ( float i = .0; i < 128.0; ++i) {
float d = map(p);
if ( abs(d) < 0.001) {
break;
}
p += rd * d;
}
float dc = exp(-0.2 * distance(ro, p) );
vec3 n = grad(p);
vec3 col = vec3(uv,0.0 ) * vec3(dc ) + vec3(dc)* (n * 0.5 + 0.5) ;
out_color = vec4(col, 1.0);
}

111
2020-03-26/nusan.glsl Normal file
View File

@ -0,0 +1,111 @@
#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 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
float time=fGlobalTime;
mat2 rot(float a) {
float ca=cos(a);
float sa=sin(a);
return mat2(ca,sa,-sa,ca);
}
float box(vec3 p, vec3 s) {
p=abs(p)-s;
return max(p.x, max(p.y,p.z));
}
float rnd(float t) {
return fract(sin(t*247.542)*567.665);
}
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 d2 = 0.0;
float map(vec3 p) {
for(int i=0; i<5; ++i) {
float t=time*0.1 + i;
p.xz *= rot(curve(t,0.3)*10.0);
p.xy *= rot(curve(t,0.23)*7.0);
p.yz = abs(p.yz) - vec2(0.3,0.8)*(curve(time, 0.2)*0.8+0.2);
}
float d = box(p, vec3(1,0.3,2.0));
d2 = length(p.xz) - 0.3;
d=min(d,d2-0.3);
return abs(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);
if(fract(time*0.1)>0.5) uv.x=abs(uv.x);
vec2 buv=uv;
for(int i=0; i<2; ++i) {
uv *= rot(time*0.1);
uv.x += abs(sin(time + uv.y)*0.1);
uv.y += abs(sin(time + uv.x)*0.3);
float size = 30 + pow(curve(time + i*12, .4+sin(uv.x*0.1+time)*0.1),10.0)*200;
uv=floor(uv*size)/size;
uv=abs(uv);
}
uv-=0.1;
vec3 s=vec3(0,0,-15);
vec3 r=normalize(vec3(-uv, 1));
vec3 col=vec3(0);
vec3 p=s;
float dd=0;
for(int i=0; i<70; ++i) {
float d=map(p) * 0.7;
if(d<0.01) {
d=0.01;
}
float d2 = sin(d+curve(time,0.2))*0.1+d;
float ff=0.02;
r.xz *= rot(sin(dd*0.3*ff));
r.yz *= rot(sin(dd*0.1*ff));
p+=r*d2;
dd+=d;
col += vec3(1,0.2,0.6) * 0.05/(abs(d)+1.6);
col += vec3(0.3,0.8,0.7) * 0.004/(abs(d2)+0.2);
}
float t3 = time*0.1+curve(time, 0.3);
col.xz *= rot(t3 + buv.x*0.7);
col.xy *= rot(t3*1.3 + buv.y*0.6);
col=abs(col);
col *= 0.4 + curve(time, 0.1);
col = smoothstep(0,1,col);
col = pow(col, vec3(0.4545));
/*
col *= smoothstep(0.1,0.4,fract(curve(uv.x*10.0 + time*0.1,0.1))*0.5)+0.5;
col *= smoothstep(0.1,0.4,fract(curve(uv.y*10.0 + time*2.3+10.0,0.1))*0.5)+0.5;
*/
out_color = vec4(col, 1);
}

106
2020-03-26/ponk.glsl Normal file
View File

@ -0,0 +1,106 @@
#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 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
float sdCube (vec3 p, vec3 r) {
vec3 b = abs(p)-r;
return max(b.x,max(b.y,b.z));
}
mat2 rot (float a) {
float c=cos(a),s=sin(a);
return mat2(c,-s,s,c);
}
#define time fGlobalTime
float map (vec3 p, inout float mat) {
float scene = 1.0;
const float count = 8.;
float a = 1.0;
float falloff = 2.5;
float speed = 0.1;
float t = time*speed;//floor(time*speed) + pow(fract(time*speed), 0.5);
float w = sin(time - length(p)*.5);
for (float index = count; index > 0.; --index) {
float r = 4. + 2. * w;
p.xz *= rot(t*2.2);
p.yz *= rot(t*4.1);
p.yx *= rot(t*2.3);
p.x = abs(p.x)-r*a;
//p.x += sin(abs(p.z));
p.y += abs(sin(p.z*2.))*.2;
scene = min(scene, sdCube(p, vec3(2.+.5*sin(abs(p.z*3.14)),0.01,1)));
a /= falloff;
}
p = abs(p)-0.2;
p.xz *= rot(- time);
p.yz *= rot(- time);
p.yx *= rot(- time*2.);
float sphs = max(abs(p.y)-2., length(p.xz)-0.02);
mat = step(sphs, scene);
scene = min(scene, sphs);
sphs = length(p)-0.2;
mat += step(sphs, scene);
scene = min(scene, sphs);
return scene * .5;
}
vec3 getNormal (vec3 p) {
vec2 e = vec2(0.001,0);
float m = 0.;
return normalize(vec3(map(p+e.xyy,m)-map(p-e.xyy,m),map(p+e.yxy,m)-map(p-e.yxy,m),map(p+e.yyx,m)-map(p-e.yyx,m)));
}
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,-12);
vec3 ray = normalize(vec3(uv,1.));
float total = 0.0;
float shade = 0.0;
float mat = 0.0;
const float count = 100.;
for (float index = count; index > 0.; --index) {
float dist = map(eye+ray*total, mat);
if (dist < 0.001) {
shade = index/count;
break;
}
total += dist;
}
vec3 color = vec3(0);
vec3 normal = getNormal(eye+ray*total);
if (mat == 0.0) {
color += .7*vec3(0.1,1.,.2) * clamp(dot(normal, -ray), 0., 1.);
color += vec3(0.54,.2,.1) * clamp(dot(normal, vec3(0,-1,0))*.5+.5, 0., 1.);
} else if (mat == 1.0) {
color += vec3(1.0) * clamp(dot(normal, vec3(0,-1,0))*.5+.5, 0., 1.);
} else if (mat == 2.0) {
color += vec3(1.,.1,0.) * clamp(dot(normal, vec3(0,-1,0))*.5+.5, 0., 1.);
}
color *= pow(shade, .2);
out_color = vec4(color,1);
}