mirror of
https://github.com/CookieCollective/Live-Coding-Sources.git
synced 2025-02-01 18:39:35 +01:00
Add 2018-06-02
This commit is contained in:
parent
84b825f173
commit
514c2018a2
128
2018-06-02/01-ponk.glsl
Normal file
128
2018-06-02/01-ponk.glsl
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
#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
|
||||||
|
|
||||||
|
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 PI 3.14159
|
||||||
|
#define TAU (2.*PI)
|
||||||
|
#define repeat(p,c) (mod(p+c/2.,c)-c/2.)
|
||||||
|
#define time fGlobalTime
|
||||||
|
|
||||||
|
mat2 rot (float t) {
|
||||||
|
float c = cos(t), s = sin(t);
|
||||||
|
return mat2(c,s,-s,c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void amod (inout vec2 p, float c) {
|
||||||
|
float an = TAU / c;
|
||||||
|
float a = atan(p.y,p.x)+c/2.;
|
||||||
|
a = mod(a, an)-an/2.;
|
||||||
|
p = vec2(cos(a),sin(a)) * length(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
float box ( vec3 p , vec3 r) {
|
||||||
|
vec3 d = abs(p)-r;
|
||||||
|
return max(d.x,max(d.y,d.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
float map (vec3 pos) {
|
||||||
|
|
||||||
|
float scene = 10.;
|
||||||
|
const float count = 5.;
|
||||||
|
for (float i = count; i >= 0.; --i) {
|
||||||
|
float r = i / count;
|
||||||
|
r = r * r;
|
||||||
|
vec3 p = pos;
|
||||||
|
p = abs(p)-1.*r;
|
||||||
|
p.xz *= rot(r* time);
|
||||||
|
p.yz *= rot(r*time * .5);
|
||||||
|
float a = atan(p.x,p.z);
|
||||||
|
amod(p.xz, 5.);
|
||||||
|
p.x = repeat(p.x - time, 2. * r);
|
||||||
|
//p.x -= 1. + sin(a * 4. + time) * .25;
|
||||||
|
scene = min(scene, length(p)-.2*r);
|
||||||
|
scene = min(scene, length(p.yz)-.01*r);
|
||||||
|
}
|
||||||
|
vec3 p = pos;
|
||||||
|
float d = length(p) * .5;
|
||||||
|
p.xz *= rot(time+d);
|
||||||
|
p.yz *= rot(time*.6+d);
|
||||||
|
p.yx *= rot(time*.3+d);
|
||||||
|
float scale = .4 + sin(time * 5.) * .2;
|
||||||
|
scene = min(scene, box(p, scale*vec3(1.)));
|
||||||
|
scene = max(scene, -box(p, scale*vec3(.9,10.,.9)));
|
||||||
|
scene = max(scene, -box(p, scale*vec3(10.,.9,.9)));
|
||||||
|
scene = max(scene, -box(p, scale*vec3(.9,.9,10.)));
|
||||||
|
//p.yz *= rot(p.x + time);
|
||||||
|
vec3 pp = p;
|
||||||
|
p.x = repeat(p.x + time, .2);
|
||||||
|
d *= .05;
|
||||||
|
|
||||||
|
scene = min(scene, box(p, vec3(.025+d)));
|
||||||
|
|
||||||
|
p = pp;
|
||||||
|
p.y = repeat(p.y + time, .2);
|
||||||
|
scene = min(scene, box(p, vec3(.025+d)));
|
||||||
|
|
||||||
|
p = pp;
|
||||||
|
p.z = repeat(p.z + time, .2);
|
||||||
|
|
||||||
|
scene = min(scene, box(p, vec3(.025+d)));
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);
|
||||||
|
uv -= 0.5;
|
||||||
|
uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
|
||||||
|
|
||||||
|
float shade = 0.;
|
||||||
|
vec3 eye = vec3(1,1,-3);
|
||||||
|
eye.xz *= rot(time*.3);
|
||||||
|
eye.xy *= rot(time*.1);
|
||||||
|
eye = normalize(eye) * length(eye) * (1.+sin(time/2.)*.5);
|
||||||
|
vec3 target = vec3(0,0,0);
|
||||||
|
vec3 forward = normalize(target - eye);
|
||||||
|
vec3 right = normalize(cross(forward, vec3(0,1,0)));
|
||||||
|
vec3 up = normalize(cross(right, forward));
|
||||||
|
vec3 ray = normalize(forward + uv.x * right + uv.y * up);
|
||||||
|
vec3 pos = eye;
|
||||||
|
|
||||||
|
//float f = texture( texFFT, d ).r * 100;
|
||||||
|
|
||||||
|
const float count = 50.;
|
||||||
|
for ( float i = count; i >= 0.; --i) {
|
||||||
|
float dist = map(pos);
|
||||||
|
if (dist < .0001) {
|
||||||
|
shade = i/count;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pos += ray * dist;
|
||||||
|
}
|
||||||
|
|
||||||
|
//float f = texture( texFFT, d ).r * 100;
|
||||||
|
float t = - time + length(pos) * 2. + shade * 16.;
|
||||||
|
vec3 color = vec3(.5)+vec3(.5)*cos(t*vec3(.1,.2,.3));
|
||||||
|
color *= 2.5;
|
||||||
|
color *= shade;
|
||||||
|
out_color = vec4(color, 1.);
|
||||||
|
}
|
99
2018-06-02/01-xtrium.glsl
Normal file
99
2018-06-02/01-xtrium.glsl
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
#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 EPS .005
|
||||||
|
|
||||||
|
float map(vec3 p)
|
||||||
|
{
|
||||||
|
float wp = p.y;
|
||||||
|
|
||||||
|
mat2 r = mat2(cos(fGlobalTime * .1), sin(fGlobalTime * .1), -sin(fGlobalTime * .1), cos(fGlobalTime * .1));
|
||||||
|
vec3 pp = p;
|
||||||
|
pp.xz = r * pp.xz;
|
||||||
|
|
||||||
|
pp.zx = r * pp.xy;
|
||||||
|
|
||||||
|
wp += (0.15 + 0.0001 * sin(fGlobalTime * 0.33)) * -abs(sin(pp.x * (10. + 4. * p.x)));
|
||||||
|
return wp + 0.3 * sin(cos(p.z) * 3.14159);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 normal(vec3 p)
|
||||||
|
{
|
||||||
|
vec2 e = vec2(0., EPS);
|
||||||
|
return normalize(vec3(map(p + e.yxx) - map(p - e.yxx), map(p + e.xyx) - map(p - e.xyx), map(p + e.xxy) - map(p - e.xxy)));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rm(vec3 ro, vec3 rd, out float tOut)
|
||||||
|
{
|
||||||
|
float t = EPS;
|
||||||
|
|
||||||
|
for(int i = 0; i < 128; ++i)
|
||||||
|
{
|
||||||
|
float d = map(ro+rd * t);
|
||||||
|
|
||||||
|
if(d < EPS)
|
||||||
|
{
|
||||||
|
tOut = t;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(t > 128.0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
t += d;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
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, 1.0, 5.0);
|
||||||
|
vec3 rd = normalize(vec3(uv, -1.5));
|
||||||
|
|
||||||
|
vec3 sc = vec3(0.25, 0.1, clamp(uv.y, 0.0, 1.0));
|
||||||
|
out_color.rgb = sc;
|
||||||
|
|
||||||
|
float tOut = 0.;
|
||||||
|
if(rm(ro, rd, tOut))
|
||||||
|
{
|
||||||
|
vec3 col1 = normal(ro + tOut * rd);
|
||||||
|
|
||||||
|
ro = ro + rd * tOut - EPS * 2.;
|
||||||
|
rd = reflect(rd, col1);
|
||||||
|
|
||||||
|
float sf = pow(dot(-rd, col1), 5.);
|
||||||
|
|
||||||
|
vec3 col2 = out_color.rgb;
|
||||||
|
float tOut2 = 0.;
|
||||||
|
if(rm(ro, rd, tOut2))
|
||||||
|
{
|
||||||
|
col2 = normal(ro + tOut * rd);
|
||||||
|
|
||||||
|
float d = pow(dot(-rd, col1), 5.);
|
||||||
|
col1 = mix(col1, col2, 1.-d);
|
||||||
|
}
|
||||||
|
|
||||||
|
float diff = dot(col1, normalize(ro + rd * tOut2));
|
||||||
|
|
||||||
|
out_color = mix(vec4(vec3(diff), 1.) + sc * (1.-diff), out_color, clamp(tOut / 32., 0., 1.));
|
||||||
|
}
|
||||||
|
}
|
81
2018-06-02/02-coyhot.glsl
Normal file
81
2018-06-02/02-coyhot.glsl
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
#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 sce (vec3 p)
|
||||||
|
{
|
||||||
|
float a = fGlobalTime;
|
||||||
|
float b = sin(a)*p.x-cos(a)*p.y;
|
||||||
|
float c = p.z*1.25;
|
||||||
|
|
||||||
|
|
||||||
|
p.y += cos(b+fGlobalTime);
|
||||||
|
p.x += sin(b+fGlobalTime);
|
||||||
|
|
||||||
|
|
||||||
|
p.xy *= mat2(cos(c), -sin(c), sin(c), cos(c));
|
||||||
|
|
||||||
|
|
||||||
|
p.xy *= mat2(cos(b), -sin(b), sin(b), cos(b));
|
||||||
|
|
||||||
|
p = mod(p,4)-2;
|
||||||
|
|
||||||
|
p.z += sin(p.y*20.+a*5.)/10.;
|
||||||
|
p.z += sin(p.x*20.+a*5.)/10.;
|
||||||
|
|
||||||
|
return length(p)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float tra (vec3 o, vec3 d)
|
||||||
|
{
|
||||||
|
float t = 0.;
|
||||||
|
|
||||||
|
for (int i=0;i<128;i++)
|
||||||
|
{
|
||||||
|
t += sce(o+d*t)*0.35;
|
||||||
|
}
|
||||||
|
return 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);
|
||||||
|
|
||||||
|
vec2 uvorig = uv;
|
||||||
|
|
||||||
|
vec4 noise = texture (texNoise,uvorig);
|
||||||
|
|
||||||
|
vec4 lines = texture (texTex2,uvorig);
|
||||||
|
|
||||||
|
|
||||||
|
uv += cos(noise.r+fGlobalTime)/5.;
|
||||||
|
|
||||||
|
uv += cos(lines.r+fGlobalTime)/20.;
|
||||||
|
|
||||||
|
|
||||||
|
float color = tra(vec3(sin(fGlobalTime),cos(fGlobalTime)/2,fGlobalTime*4.),normalize(vec3(uv*10.,1.0)));
|
||||||
|
float fog = 1/(1+color*color-1);
|
||||||
|
|
||||||
|
out_color = vec4(vec3(color*fog*4.),1.0);
|
||||||
|
|
||||||
|
|
||||||
|
out_color *= vec4(uv.x+1.0,uv.y+0.5,abs(sin(fGlobalTime*5.)),1.0);
|
||||||
|
}
|
105
2018-06-02/02-lamogui.glsl
Normal file
105
2018-06-02/02-lamogui.glsl
Normal 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 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 bass;
|
||||||
|
|
||||||
|
float megabass()
|
||||||
|
{
|
||||||
|
float b = 0.0;
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
b = max(texelFetch(texFFTIntegrated, i, 0).x, b);
|
||||||
|
}
|
||||||
|
return b * 8.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mat2 rot(float a)
|
||||||
|
{
|
||||||
|
float c = cos(a);
|
||||||
|
float s = sin(a);
|
||||||
|
return mat2(c, s, -s, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
float dur(vec3 p)
|
||||||
|
{
|
||||||
|
p.xy *= rot(p.z * 0.1);
|
||||||
|
p.z += 0.1 * texture(texNoise, p.xy).x;
|
||||||
|
return cos(p.x) + cos(p.y) + cos(p.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 rm(vec3 ro, vec3 rd, out float st, int it)
|
||||||
|
{
|
||||||
|
st = 1.0;
|
||||||
|
vec3 p = ro;
|
||||||
|
for (int i = 0; i < it; ++i)
|
||||||
|
{
|
||||||
|
float d = dur(p);
|
||||||
|
if (abs(d) < 0.01)
|
||||||
|
{
|
||||||
|
st = float(st) /float(it);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p += rd * d * 0.8;
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 shade(vec3 ro, vec3 p, vec3 n, float st)
|
||||||
|
{
|
||||||
|
float off = p.x + p.y + p.z;
|
||||||
|
vec3 c = vec3(0.5 + 0.5 * cos(bass + off), 0.5 + 0.5 * sin(bass + off), 1.0);
|
||||||
|
|
||||||
|
return vec3(exp(-distance(ro, p) * 0.1)) * c * (1.0 - st);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 grad(vec3 p)
|
||||||
|
{
|
||||||
|
vec2 eps = vec2(0.01, 0.0);
|
||||||
|
return normalize(
|
||||||
|
vec3(dur(p + eps.xyy) - dur(p - eps.xyy),
|
||||||
|
dur(p + eps.yxy) - dur(p - eps.yxy),
|
||||||
|
dur(p + eps.yyx) - dur(p - eps.yyx))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
bass = megabass();
|
||||||
|
vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);
|
||||||
|
uv -= 0.5;
|
||||||
|
uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
|
||||||
|
|
||||||
|
float st;
|
||||||
|
vec3 ro = vec3(0.0, 0.0, bass);
|
||||||
|
vec3 rd = normalize(vec3(uv, 0.4 - length(uv)));
|
||||||
|
|
||||||
|
vec3 p = rm(ro, rd, st, 32);
|
||||||
|
vec3 n = grad(p);
|
||||||
|
vec3 color = shade(ro, p, n, st);
|
||||||
|
|
||||||
|
vec3 rd2 = reflect(rd, n);
|
||||||
|
vec3 ro2 = p + rd2 * 0.1;
|
||||||
|
float st2;
|
||||||
|
|
||||||
|
vec3 p2 = rm(ro2, rd2, st2, 8);
|
||||||
|
vec3 n2 = grad(p2);
|
||||||
|
|
||||||
|
color = mix(color, shade(ro, p2, n2, st2), 0.4);
|
||||||
|
|
||||||
|
color = pow(color, vec3(1.0 / 2.2));
|
||||||
|
out_color = vec4(color, 1.0);
|
||||||
|
}
|
118
2018-06-02/03-flopine.glsl
Normal file
118
2018-06-02/03-flopine.glsl
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
#version 410 core
|
||||||
|
|
||||||
|
uniform float fGlobalTime; // in seconds
|
||||||
|
uniform vec2 v2Resolution; // viewport resolution (in pixels)
|
||||||
|
|
||||||
|
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
|
||||||
|
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients
|
||||||
|
uniform sampler1D texFFTIntegrated; // this is continually increasing
|
||||||
|
uniform sampler2D 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)
|
||||||
|
{
|
||||||
|
return mat2(cos(a),sin(a),-sin(a),cos(a));
|
||||||
|
}
|
||||||
|
|
||||||
|
float tiktak(float per)
|
||||||
|
{
|
||||||
|
float tik = floor(time) + pow(fract(time), 3.);
|
||||||
|
tik *= 3. * per;
|
||||||
|
return tik;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 moda (vec2 p, float per)
|
||||||
|
{
|
||||||
|
float a = atan(p.y, p.x);
|
||||||
|
float l = length(p);
|
||||||
|
a = mod(a-per/2., per)-per/2.;
|
||||||
|
return vec2 (cos(a),sin(a))*l;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec2 mo (vec2 p, vec2 d)
|
||||||
|
{
|
||||||
|
p.x = abs(p.x)-d.x;
|
||||||
|
p.y = abs(p.y)-d.y;
|
||||||
|
if (p.y > p.x) p.xy = p.yx;
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
float stmin(float a, float b, float k, float n)
|
||||||
|
{
|
||||||
|
float st = k/n;
|
||||||
|
float u = b-k;
|
||||||
|
return min(min(a,b), 0.5 * (u+a+abs(mod(u-a+st,2.*st)-st)));
|
||||||
|
}
|
||||||
|
|
||||||
|
float cyl (vec2 p, float r)
|
||||||
|
{return length(p)-r;}
|
||||||
|
|
||||||
|
|
||||||
|
float odile (vec3 p, float d)
|
||||||
|
{return dot(p, normalize(sign(p)))-d;}
|
||||||
|
|
||||||
|
|
||||||
|
float helix (vec3 p)
|
||||||
|
{
|
||||||
|
|
||||||
|
p.xz *= rot(p.y*0.8);
|
||||||
|
p.xz *= rot(time);
|
||||||
|
p.xz = moda(p.xz, 2.*3.141592/5.);
|
||||||
|
p.x -= .8;
|
||||||
|
return cyl(p.xz, .15);
|
||||||
|
}
|
||||||
|
|
||||||
|
float SDF (vec3 p)
|
||||||
|
{
|
||||||
|
float per = 10.;
|
||||||
|
//p.xy *= rot( tiktak(time , 0.5) );
|
||||||
|
p.xy *= rot(time);
|
||||||
|
p.xz *= rot(time);
|
||||||
|
//p.z = mod(p.z-per/2., per)-per/2.;
|
||||||
|
|
||||||
|
p.xy = mo(p.xy, vec2(2.));
|
||||||
|
p.xz = mo(p.xz, vec2(2.));
|
||||||
|
p.xy = moda(p.xy, 2.*3.141592/8.);
|
||||||
|
|
||||||
|
p.x -= 3.;
|
||||||
|
|
||||||
|
return stmin(helix(p), odile(p,1.), 0.4, 5.);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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.01,0.01,-15.); vec3 p = ro;
|
||||||
|
vec3 dir = normalize(vec3(uv,1.));
|
||||||
|
|
||||||
|
float shad = 0.;
|
||||||
|
|
||||||
|
for (float i = 0.; i< 64.; i++)
|
||||||
|
{
|
||||||
|
float d = SDF(p);
|
||||||
|
if (d<0.001)
|
||||||
|
{
|
||||||
|
shad = i/64.;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p+= d*dir*0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
float t = length(ro-p);
|
||||||
|
|
||||||
|
vec3 c = vec3(shad);
|
||||||
|
c = mix(c, vec3(0.1, -length(uv),length(uv)), 1. - exp(-0.001*t*t));
|
||||||
|
out_color = vec4(c,1.);
|
||||||
|
}
|
112
2018-06-02/03-ponk.glsl
Normal file
112
2018-06-02/03-ponk.glsl
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
#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 sdist(p,r) (length(p)-r)
|
||||||
|
#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);
|
||||||
|
}
|
||||||
|
|
||||||
|
void amod (inout vec2 p, float c) {
|
||||||
|
float an = (3.14159*2.)/c;
|
||||||
|
float a = atan(p.y,p.x)+an/2.;
|
||||||
|
a = mod(a, an)-an/2.;
|
||||||
|
p = vec2(cos(a),sin(a))*length(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
float smin ( float a, float b, float t) {
|
||||||
|
float h = clamp(.5+.5*(b-a)/t,0.,1.);
|
||||||
|
return mix(b,a,h)-t*h*(1.-h);
|
||||||
|
}
|
||||||
|
|
||||||
|
float map (vec3 pos) {
|
||||||
|
float scene = 10.;
|
||||||
|
vec3 p = pos;
|
||||||
|
const float count = 3.;
|
||||||
|
for (float i = count; i >= 0.; --i) {
|
||||||
|
float r = i / count;
|
||||||
|
r = r * r;
|
||||||
|
p.xz *= rot(p.y * .4 / r);
|
||||||
|
amod(p.xz, 5.);
|
||||||
|
p.x -= .5 * r - sin(time * 2. + p.y * 2. + r * 3.14529) * .1 * r;
|
||||||
|
vec3 pp = p;
|
||||||
|
scene = min(scene, sdist(p.xz, .01));
|
||||||
|
}
|
||||||
|
p = pos;
|
||||||
|
p.xz = vec2(atan(p.x,p.z),length(p.xz));
|
||||||
|
p.y += sin(atan(p.z,p.x)/3.14159/2.)*.2;
|
||||||
|
p.y = repeat(p.y+time, .6);
|
||||||
|
float wave = 1. - .1*sin(time * 2. + pos.y * 4.);
|
||||||
|
p.z -= wave;
|
||||||
|
scene = min(scene, sdist(p.zy, .01));
|
||||||
|
p = pos;
|
||||||
|
p.xz *= rot(p.y);
|
||||||
|
amod(p.xz, 8.);
|
||||||
|
p.x -= wave;
|
||||||
|
scene = smin(scene, sdist(p.xz, .01), .1);
|
||||||
|
p = pos;
|
||||||
|
p.xz *= rot(-p.y);
|
||||||
|
amod(p.xz, 8.);
|
||||||
|
p.x -= wave;
|
||||||
|
scene = smin(scene, sdist(p.xz, .01), .1);
|
||||||
|
float dd = length(pos);
|
||||||
|
p.y += atan(pos.z,pos.x) * .5;
|
||||||
|
scene = smin(scene, sdist(p.yz, .01 - dd * .03), .1);
|
||||||
|
p.x -= .5;
|
||||||
|
p.x = repeat(p.x, .8);
|
||||||
|
scene = smin(scene, sdist(p.xy, .02), .2);
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(void)
|
||||||
|
{
|
||||||
|
vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);
|
||||||
|
uv -= 0.5;
|
||||||
|
uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
|
||||||
|
|
||||||
|
vec3 eye = vec3(0,1,-3);
|
||||||
|
eye.xz *= rot(time);
|
||||||
|
eye.z += sin(time);
|
||||||
|
vec3 target = vec3(0);
|
||||||
|
vec3 front = normalize(target - eye);
|
||||||
|
vec3 right = normalize(cross(vec3(0,1,0),front));
|
||||||
|
vec3 up = normalize(cross(front, right));
|
||||||
|
vec3 ray = normalize(front + uv.x * right + uv.y * up);
|
||||||
|
vec3 color = vec3(uv,0);
|
||||||
|
float shade = 0.;
|
||||||
|
vec3 pos = eye;
|
||||||
|
const float count = 70.;
|
||||||
|
for (float i = count; i >= 0.; --i) {
|
||||||
|
|
||||||
|
float dist = map(pos);
|
||||||
|
if (dist < .0001) {
|
||||||
|
shade = i / count;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
dist *= .5;
|
||||||
|
pos += ray * dist;
|
||||||
|
}
|
||||||
|
|
||||||
|
float t = shade * 40. + time;
|
||||||
|
color = vec3(.75)+vec3(.25)*cos(vec3(.1,.2,.3)*t);
|
||||||
|
color *= shade;
|
||||||
|
|
||||||
|
out_color = vec4(color, 1);
|
||||||
|
}
|
80
2018-06-02/04-coyhot.glsl
Normal file
80
2018-06-02/04-coyhot.glsl
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
#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 sce(vec3 p)
|
||||||
|
{
|
||||||
|
float a = fGlobalTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
p.y -= p.z;
|
||||||
|
p.x += p.z;
|
||||||
|
|
||||||
|
p.z -= fGlobalTime/350.;
|
||||||
|
p.yz *= mat2(cos(a*2), -sin(a*2), sin(a*2), cos(a*2));
|
||||||
|
p.xz *= mat2(cos(a), -sin(a), sin(a), cos(a));
|
||||||
|
|
||||||
|
p.xy *= mat2(cos(a), -sin(a), sin(a), cos(a));
|
||||||
|
|
||||||
|
p = mod(p,3)-1.5;
|
||||||
|
|
||||||
|
p.z += floor(sin(p.y*20.)/5.);
|
||||||
|
p.z += floor(sin(p.x*20.)/5.);
|
||||||
|
|
||||||
|
return length(p)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float tra(vec3 o, vec3 d)
|
||||||
|
{
|
||||||
|
float t = 2.;
|
||||||
|
|
||||||
|
for (int i=0;i<128;i++)
|
||||||
|
{
|
||||||
|
t += sce(o+d*t)*0.25;
|
||||||
|
}
|
||||||
|
return 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);
|
||||||
|
|
||||||
|
vec2 uvorig = uv;
|
||||||
|
|
||||||
|
vec4 noise = texture(texNoise,uvorig);
|
||||||
|
vec4 disto = texture(texTex3,uvorig);
|
||||||
|
|
||||||
|
|
||||||
|
uv.x += fGlobalTime/50000.;
|
||||||
|
uv.y += fGlobalTime/50000.;
|
||||||
|
|
||||||
|
uv += noise.r /5.;
|
||||||
|
uv += disto.r /40.;
|
||||||
|
|
||||||
|
|
||||||
|
float color = tra(vec3(0.,0.,-1+fGlobalTime/250.),normalize(vec3(uv*6.,1.0)));
|
||||||
|
float fog = 1/(1+color*color-1.0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
out_color = vec4(vec3(color*fog),1.0);
|
||||||
|
out_color += vec4(sin(uv.x),sin(uv.y),abs(sin(fGlobalTime)),1.0);
|
||||||
|
|
||||||
|
}
|
125
2018-06-02/04-lsdlive.glsl
Normal file
125
2018-06-02/04-lsdlive.glsl
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
#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
|
||||||
|
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vec2 path(float t){
|
||||||
|
float a=sin(1.5+t*.2),b=sin(t*.2);
|
||||||
|
return vec2(2*a,a*b);
|
||||||
|
}
|
||||||
|
|
||||||
|
float g=0.;
|
||||||
|
|
||||||
|
float dt=0.;
|
||||||
|
float re(float p,float d){return mod(p-d*.5,d)-d*.5;}
|
||||||
|
void amod(inout vec2 p,float d){float a=re(atan(p.x,p.y),d);p=vec2(cos(a),sin(a))*length(p);}
|
||||||
|
void mo(inout vec2 p,vec2 d){p.x=abs(p.x)-d.x;p.y=abs(p.y)-d.y;if(p.y>p.x)p=p.yx;}
|
||||||
|
#define time fGlobalTime
|
||||||
|
mat2 r2d(float a){float c=cos(a),s=sin(a);return mat2(c,s,-s,c);}
|
||||||
|
float sc(vec3 p,float d){p=abs(p);p=max(p,p.yzx);return min(p.x,min(p.y,p.z))-d;}
|
||||||
|
float de(vec3 p){
|
||||||
|
|
||||||
|
p.xy-=path(p.z);
|
||||||
|
|
||||||
|
|
||||||
|
//p.y+=.5;
|
||||||
|
float t=time*9;
|
||||||
|
float s=.77+2.5*(t*.1+sin(t)*.1);
|
||||||
|
//p.xz*=r2d(s);
|
||||||
|
//p.xy*=r2d(s);
|
||||||
|
|
||||||
|
vec3 q=p;
|
||||||
|
q.xy*=r2d(q.z*.3);
|
||||||
|
amod(q.xy, 6.28/3.);
|
||||||
|
q.x=abs(q.x)-1.1;
|
||||||
|
float cyl = length(q.xy)-.08;
|
||||||
|
|
||||||
|
q=p;
|
||||||
|
q.z-=3.+dt;
|
||||||
|
q.xy+=.1*vec2(cos(p.z*.2)*sin(p.z*.2),sin(p.z*.1));
|
||||||
|
q.xz*=r2d(s);
|
||||||
|
q.xy*=r2d(s);
|
||||||
|
float od=dot(q,normalize(sign(q)))-.3;
|
||||||
|
|
||||||
|
p.xy*=r2d(-p.z*.1);
|
||||||
|
|
||||||
|
mo(p.xy,vec2(.5, .3));
|
||||||
|
|
||||||
|
amod(p.xy, 6.28/3.);
|
||||||
|
|
||||||
|
//p.xy*=r2d(p.z*.1);
|
||||||
|
|
||||||
|
p.z=re(p.z,2);
|
||||||
|
mo(p.xy,vec2(.4, 1.));
|
||||||
|
|
||||||
|
amod(p.xy, .785*.75);
|
||||||
|
//mo(p.xz,vec2(54, 4));
|
||||||
|
|
||||||
|
|
||||||
|
//p.x=abs(p.x)-1;
|
||||||
|
|
||||||
|
p.xy *= r2d(3.14*.25);
|
||||||
|
float d= sc(p, .2);
|
||||||
|
|
||||||
|
d= min(d,cyl);
|
||||||
|
|
||||||
|
d=min(d,od);
|
||||||
|
g+=.01/(.01+d*d);
|
||||||
|
return d;
|
||||||
|
return length(p)-1;
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
|
||||||
|
dt=time*7.;
|
||||||
|
|
||||||
|
vec3 ro=vec3(0,0,-3+dt);
|
||||||
|
//rd=normalize(vec3(uv,.8-length(uv)))
|
||||||
|
vec3 p;
|
||||||
|
|
||||||
|
vec3 ta=vec3(0,0,dt);
|
||||||
|
|
||||||
|
ro.xy+=path(ro.z);
|
||||||
|
ta.xy+=path(ta.z);
|
||||||
|
|
||||||
|
vec3 f=normalize(ta-ro);
|
||||||
|
vec3 l=cross(vec3(0,1,0),f);
|
||||||
|
vec3 u=cross(f,l);
|
||||||
|
vec3 rd=normalize(f+uv.x*l+uv.y*u);
|
||||||
|
|
||||||
|
float t=0,i=0;
|
||||||
|
for(;i<1;i+=.01){p=ro+rd*t;float d=de(p);
|
||||||
|
if(d<.001)break;
|
||||||
|
t+=d*.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
vec3 c=mix(vec3(.9,.3,.2), vec3(.1,.1,.2), sin(uv.x*3.)+i);
|
||||||
|
c.g+=sin(p.z)*.2;
|
||||||
|
c+=g*.025;
|
||||||
|
c=mix(c,vec3(.1,.1,.2),1-exp(-.004*t*t));
|
||||||
|
out_color = vec4(c,1);;
|
||||||
|
}
|
84
2018-06-02/05-coyhot.glsl
Normal file
84
2018-06-02/05-coyhot.glsl
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#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 sce(vec3 p)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
float a = sin(p.z)/5.;
|
||||||
|
float b = p.z/100.;
|
||||||
|
float c = a*2.;
|
||||||
|
float d = -fGlobalTime;
|
||||||
|
float e = sin(d)/100000.;
|
||||||
|
|
||||||
|
|
||||||
|
p.xz *= mat2 (cos(e),-sin(e),sin(e),cos(e));
|
||||||
|
|
||||||
|
|
||||||
|
p.xy *= mat2 (cos(d),-sin(d),sin(d),cos(d));
|
||||||
|
p.xy *= mat2 (cos(c),-sin(c),sin(c),cos(c));
|
||||||
|
|
||||||
|
p.x += sin(p.z);
|
||||||
|
|
||||||
|
|
||||||
|
p.xy *= mat2 (cos(a/b),-sin(a),sin(a),cos(a));
|
||||||
|
p.xy *= mat2 (cos(a),-sin(a),sin(a),cos(a));
|
||||||
|
|
||||||
|
|
||||||
|
p=mod(p,4)-2;
|
||||||
|
|
||||||
|
p.z /= 5.;
|
||||||
|
p.x += 1.75;
|
||||||
|
|
||||||
|
p.z +=sin(p.y*25.+fGlobalTime*5.)/10.;
|
||||||
|
p.z +=sin(p.x*25.+fGlobalTime*5.)/10.;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return length(p)-1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float tra(vec3 o, vec3 d)
|
||||||
|
{
|
||||||
|
float t = 0.;
|
||||||
|
|
||||||
|
for (int i=0; i<64; i++)
|
||||||
|
{
|
||||||
|
t += sce(o+d*t)*0.5;
|
||||||
|
}
|
||||||
|
return 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);
|
||||||
|
|
||||||
|
float color = tra(vec3(cos(fGlobalTime),sin(fGlobalTime),fGlobalTime*10.), normalize(vec3(uv*2.5, 1.0)));
|
||||||
|
float fog = 1/(1+color*color-1);
|
||||||
|
|
||||||
|
out_color = vec4(vec3(color*fog),1.0);
|
||||||
|
out_color += vec4(abs(sin(uv.x)),abs(sin(uv.y)/2.5),abs(sin(fGlobalTime)),1.0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
86
2018-06-02/05-ponk.glsl
Normal file
86
2018-06-02/05-ponk.glsl
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
#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 smoo(p,r) smoothstep(r,r*1.01,p)
|
||||||
|
#define time fGlobalTime
|
||||||
|
#define repeat(p,r) (mod(p,r)-r/2.)
|
||||||
|
|
||||||
|
void amod (inout vec2 p, float c) {
|
||||||
|
float an = (3.14159*2.)/c;
|
||||||
|
float a = atan(p.y,p.x)+an/2.;
|
||||||
|
a = mod(a, an)-an/2.;
|
||||||
|
p = vec2(cos(a),sin(a)) * length(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
vec2 ppp = uv;
|
||||||
|
vec2 uu = uv;
|
||||||
|
float wave1 = smoothstep(-1.,.5,sin(time));
|
||||||
|
float wave2 = smoothstep(-1.,.1,sin(time*2.));
|
||||||
|
float wave3 = smoothstep(-1.,.0,sin(time/2.));
|
||||||
|
uv = mix(uv, vec2(atan(uv.y,uv.x), length(uv)), wave3);
|
||||||
|
uv.x = mix(uv.x, abs(uv.x), wave1);
|
||||||
|
uv.y = mix(uv.y, abs(uv.y), wave2);
|
||||||
|
float t = length(uv) * 20. - time;
|
||||||
|
vec3 color = vec3(.9)+vec3(.1)*cos(vec3(.1,.2,.3)*t);
|
||||||
|
float d = length(uv);
|
||||||
|
vec2 p = uv;
|
||||||
|
p *= rot(time+d + sin(d*10.-time)*.1);
|
||||||
|
amod(p, 8.);
|
||||||
|
p.x -= .5;
|
||||||
|
p.x = repeat(p.x - time * .5, .2);
|
||||||
|
vec2 pp = p;
|
||||||
|
p *= rot(time);
|
||||||
|
float scale = 1. + .1 * sin(time * 16.);
|
||||||
|
p *= scale;
|
||||||
|
p.y += .05;
|
||||||
|
p.x /= 1.5;
|
||||||
|
p.y -= sqrt(abs(p.x)) * .25;
|
||||||
|
float shape = smoo(length(p), .01+.1 * d);
|
||||||
|
//shape *= smoo(abs(sin(pp.x*10.)), .02);
|
||||||
|
shape = clamp(shape, 0.,1.);
|
||||||
|
|
||||||
|
ppp.y += .05;
|
||||||
|
ppp.x /= 1.5;
|
||||||
|
ppp.y -= sqrt(abs(ppp.x)) * .45;
|
||||||
|
shape = mix(1.-shape, shape, smoo(length(ppp), .2 + .1*sin(time*4.)));
|
||||||
|
color = mix(vec3(1,0,0), color, shape);
|
||||||
|
//color = mix(1.-color, color, smoo(length(ppp), .2 + .1*sin(time*4.)));
|
||||||
|
|
||||||
|
|
||||||
|
float dust = 0.;
|
||||||
|
|
||||||
|
for (float i = 10.; i >= 0.; --i) {
|
||||||
|
float rr = i / 10.;
|
||||||
|
float a = i * 5. + time;
|
||||||
|
float r = i * .05;
|
||||||
|
vec2 v = vec2(cos(a),sin(a))*r;
|
||||||
|
dust += .002/abs(length(v-uu)-.1*rr+.1*sin(-time*4.+r*10.));
|
||||||
|
dust += .001/abs(sin(uu.y*10.+atan(uu.y,uu.x)*10.+time)+.2*sin(-time*4.+r*10.));
|
||||||
|
}
|
||||||
|
color += dust;
|
||||||
|
out_color = vec4(color, 1);
|
||||||
|
}
|
86
2018-06-02/06-lsdlive.glsl
Normal file
86
2018-06-02/06-lsdlive.glsl
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
#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
|
||||||
|
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
float g=0;
|
||||||
|
void mo(inout vec2 p,vec2 d){p.x=abs(p.x)-d.x;p.y=abs(p.y)-d.y;if(p.y>p.x)p=p.yx;}
|
||||||
|
float re(float p,float d){return mod(p-d*.5,d)-d*.5;}
|
||||||
|
void amod(inout vec2 p,float d){float a=re(atan(p.x,p.y),d);p=vec2(cos(a),sin(a))*length(p);}
|
||||||
|
#define time fGlobalTime
|
||||||
|
mat2 r2d(float a){float c=cos(a),s=sin(a);return mat2(c,s,-s,c);}
|
||||||
|
float de(vec3 p){
|
||||||
|
|
||||||
|
p=floor(p*15)/15;
|
||||||
|
|
||||||
|
//p.xz*=r2d(time);
|
||||||
|
p.xy*=r2d(time*.3);
|
||||||
|
|
||||||
|
vec3 q=p;
|
||||||
|
q.xy+=.4;
|
||||||
|
q.xy*=r2d(time);
|
||||||
|
|
||||||
|
q.xy*=r2d(q.z*.3);
|
||||||
|
//q.xy*=r2d(3.14*.25);
|
||||||
|
mo(p.xy, vec2(1, 2));
|
||||||
|
amod(p.xy, .785*.75);
|
||||||
|
mo(p.xy, vec2(.4, .2));
|
||||||
|
q.x=abs(q.x)-1.;
|
||||||
|
float cyl=length(q.xy)-.2;
|
||||||
|
|
||||||
|
q=p;
|
||||||
|
q.xy*=r2d(-time*1.8);
|
||||||
|
q.xy*=r2d(q.z*.3);
|
||||||
|
amod(q.xy,6.28/5);
|
||||||
|
q.x=abs(q.x)-4.8;
|
||||||
|
float cyl2=length(q.xy)-.4;
|
||||||
|
|
||||||
|
|
||||||
|
//p.xy*=r2d(sin(time*.3)*.9);
|
||||||
|
float d= cos(p.x)+cos(p.y)+cos(p.z);//+ texture(texNoise, p.xy).r*.2;
|
||||||
|
//d=max(d,-cyl3);
|
||||||
|
d=min(d,cyl);
|
||||||
|
d=min(d,cyl2);
|
||||||
|
g=.01/(.01+d*d);
|
||||||
|
return d;
|
||||||
|
return dot(p,normalize(sign(p)))-.6;
|
||||||
|
}
|
||||||
|
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 th=time*5.;
|
||||||
|
float s=2.5*(th*.1+sin(th*.1));
|
||||||
|
vec3 ro=vec3(0,0,-3+time),rd=normalize(vec3(uv,.7-length(uv))),p;
|
||||||
|
float t=0,i=0;
|
||||||
|
for(;i<1;i+=.01){p=ro+rd*t;float d=de(p);
|
||||||
|
//if(d<.001)break;
|
||||||
|
d=max(abs(d),.005);
|
||||||
|
t+=d*.4;
|
||||||
|
|
||||||
|
}
|
||||||
|
vec3 c=mix(vec3(.9,.5,.2),vec3(.1,.2,.1), sin(uv.x*5.)+i);
|
||||||
|
c.r+=sin(p.z*.4)*.8;
|
||||||
|
c+=g*1;
|
||||||
|
c=mix(c,vec3(.1,.15,.22),1-exp(-.01*t*t));
|
||||||
|
out_color = vec4(c,1);;
|
||||||
|
}
|
117
2018-06-02/06_flopine.glsl
Normal file
117
2018-06-02/06_flopine.glsl
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
#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)
|
||||||
|
{return mat2(cos(a),sin(a),-sin(a),cos(a));}
|
||||||
|
|
||||||
|
float tiktak (float per)
|
||||||
|
{
|
||||||
|
float tik = floor(time) + pow(fract(time), 3.);
|
||||||
|
tik *= 3.*per;
|
||||||
|
return tik;
|
||||||
|
}
|
||||||
|
|
||||||
|
float g = 0.;
|
||||||
|
|
||||||
|
float megabass ()
|
||||||
|
{
|
||||||
|
return texture (texFFT, 0.5).r;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec3 palette (float t, vec3 a, vec3 b, vec3 c, vec3 d)
|
||||||
|
{
|
||||||
|
return a+b*cos(c*(t+d));
|
||||||
|
}
|
||||||
|
|
||||||
|
float stmin(float a, float b, float k, float n)
|
||||||
|
{
|
||||||
|
float st = k/n;
|
||||||
|
float u = b-k;
|
||||||
|
return min(min(a,b), 0.5 * (u+a+abs(mod(u-a+st, 2.*st)-st)));
|
||||||
|
}
|
||||||
|
|
||||||
|
float sphe (vec3 p, float r)
|
||||||
|
{return length(p)-r;}
|
||||||
|
|
||||||
|
float box (vec3 p, vec3 c)
|
||||||
|
{return length(max(abs(p)-c,0.));}
|
||||||
|
|
||||||
|
float prim1 (vec3 p)
|
||||||
|
{
|
||||||
|
p.xz *= rot(time);
|
||||||
|
p.xy *= rot(time);
|
||||||
|
return max(-sphe(p,1.3 +( sin(time)*0.5)), box(p,vec3(1.)) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float fractal (vec3 p, int STP)
|
||||||
|
{
|
||||||
|
float c = prim1(p);
|
||||||
|
for (int i = 0; i<STP; i++)
|
||||||
|
{
|
||||||
|
p = abs(p);
|
||||||
|
p.xz *= rot(3.141592/4.);
|
||||||
|
p.xy *= rot(3.141592/3.);
|
||||||
|
p.x -= 2. + exp(-fract(time)+1.);
|
||||||
|
p.z += sin(p.x*0.2);
|
||||||
|
c = stmin(c, prim1(p),0.5, 3.);
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
float SDF (vec3 p)
|
||||||
|
{
|
||||||
|
p.xy *= rot(tiktak(0.5));
|
||||||
|
float f = fractal(p, 4);
|
||||||
|
g += f*0.5;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
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, -30.+megabass()); vec3 p = ro;
|
||||||
|
vec3 dir = normalize(vec3(uv,1.));
|
||||||
|
|
||||||
|
float shad = 0.;
|
||||||
|
for (float i=0.; i<64.; i++)
|
||||||
|
{
|
||||||
|
float d = SDF(p);
|
||||||
|
if (d<0.001)
|
||||||
|
{
|
||||||
|
shad = i/64.;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p+= d*dir*0.8;
|
||||||
|
}
|
||||||
|
float t = length(ro-p);
|
||||||
|
|
||||||
|
vec3 pal = palette(length(uv),
|
||||||
|
vec3(0.5),
|
||||||
|
vec3(0.5),
|
||||||
|
vec3(5.),
|
||||||
|
vec3(0.,0.8,0.8));
|
||||||
|
|
||||||
|
vec3 c = (vec3(shad)*2.)*vec3(0.5, p.z, p.z);
|
||||||
|
c = mix(c, pal, 1.-exp(-0.001*t*t));
|
||||||
|
out_color = vec4 (c,1.);
|
||||||
|
}
|
42
2018-06-02/Readme.md
Normal file
42
2018-06-02/Readme.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Shader Showdown Paris #3
|
||||||
|
|
||||||
|
On June 2th, 2018 during the [VIP 2018](http://vip2018.popsyteam.org/) at Thoissey, France.
|
||||||
|
|
||||||
|
## Rounds
|
||||||
|
|
||||||
|
1. ponk vs xtrium
|
||||||
|
2. CoyHot vs lamogui
|
||||||
|
3. Flopine vs ponk
|
||||||
|
4. CoyHot vs lsdlive
|
||||||
|
5. CoyHot vs ponk
|
||||||
|
6. Flopine vs lsdlive
|
||||||
|
|
||||||
|
## Tournament view
|
||||||
|
|
||||||
|
```
|
||||||
|
ponk ----
|
||||||
|
} ponk ----
|
||||||
|
xtrium -- \
|
||||||
|
} Flopine -
|
||||||
|
/ \
|
||||||
|
Flopine - \
|
||||||
|
\
|
||||||
|
} Flopine
|
||||||
|
CoyHot -- /
|
||||||
|
} CoyHot -- /
|
||||||
|
lamogui - \ /
|
||||||
|
} lsdlive -
|
||||||
|
/
|
||||||
|
lsdlive -
|
||||||
|
```
|
||||||
|
|
||||||
|
## Results
|
||||||
|
|
||||||
|
1. Flopine
|
||||||
|
2. lsdlive
|
||||||
|
3. ponk
|
||||||
|
4. CoyHot
|
||||||
|
|
||||||
|
## Software
|
||||||
|
|
||||||
|
[Bonzomatic](https://github.com/Gargaj/Bonzomatic)
|
Loading…
Reference in New Issue
Block a user