mirror of
https://github.com/CookieCollective/Live-Coding-Sources.git
synced 2025-08-11 08:40:54 +02:00
Added livecoding 2019-11-30 shader from lamogui laptop
This commit is contained in:
107
2019-11-30/01-lamogui.glsl
Normal file
107
2019-11-30/01-lamogui.glsl
Normal 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
|
||||
float t = 0.0;
|
||||
|
||||
mat3 rot(vec3 v, float a){
|
||||
float c = cos(a);
|
||||
float s = sin(a);
|
||||
float _c = 1.0 - c;
|
||||
return mat3( c + _c * v.x * v.x, _c * v.x * v.y + s * _c * v.z, _c * v.x * v.z - s *v.y,
|
||||
_c * v.x * v.y - s * v.z, c +_c * v.y * v.y, _c * v.x * v.z + s * v.y,
|
||||
_c * v.x * v.z + s * v.y, _c * v.y * v.z - s * v.x, c + _c * v.z *v.z );
|
||||
}
|
||||
|
||||
|
||||
float coscoscos(vec3 p )
|
||||
{
|
||||
vec3 g = rot(vec3(0.0,.0,1.0), p.z * 0.1) * p;
|
||||
return cos(g.x) + cos(g.y) + cos(g.z);
|
||||
}
|
||||
|
||||
|
||||
float grass( vec3 p ){
|
||||
float id = textureLod(texNoise, floor(p.xz)/512.0, 0).r;
|
||||
p.xz = mod(p.xz, 3.0) - 1.5;
|
||||
|
||||
float h= p.y;
|
||||
p = rot(vec3(0.,1.,0.),60. * id + 360.0 * fract(texture(texFFTIntegrated, 0.1).x * 0.01)) * p;
|
||||
p = rot(vec3(1.,.0,.0), p.y * 0.2) * p;
|
||||
return length(p.xz) - id + pow(h * 0.2, 4.0);
|
||||
|
||||
}
|
||||
|
||||
float map(vec3 p) {
|
||||
float d = 1000000.0;
|
||||
|
||||
d = min(d, p.y);
|
||||
|
||||
d = min(d,coscoscos(p));
|
||||
float gs = 80.0;
|
||||
vec3 pg = p * gs;
|
||||
d = min(d, grass(pg) / gs);
|
||||
d = min(d, grass(pg + vec3( 5.15856418916, 0.0, 7.4781)) / gs);
|
||||
d = min(d, grass(pg - vec3( 3.018, 0.0, 2.0015)) / gs);
|
||||
|
||||
return d;
|
||||
}
|
||||
vec3 grad( vec3 p ){
|
||||
vec2 e =vec2(0.01, 0.0);
|
||||
float d = map(p);
|
||||
return normalize(vec3(d-map(p+e.xyy), d -map(p+e.yxy), d - 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);
|
||||
float t = texture(texFFTIntegrated, 0.3).r;
|
||||
vec3 ro = vec3(0.0,0.2,fGlobalTime * 0.3);
|
||||
vec3 rd = normalize(vec3(uv, 0.7 - length(uv)));
|
||||
float st = 1.0;
|
||||
vec3 p = ro;
|
||||
for (float i = 0.0; i < 256.0; ++i){
|
||||
float d = map(p);
|
||||
if ( abs (d) < 0.001) {
|
||||
st = i/256.0;
|
||||
break;
|
||||
}
|
||||
p += rd * 2.0 *d * i / 256.0;
|
||||
}
|
||||
vec3 color = mix(vec3(0.4,1.0,0.6) * st, vec3(1.0), 0.01 * distance(ro, p)) ;
|
||||
|
||||
if ( abs(coscoscos(p)) < 0.1) {
|
||||
|
||||
float st2 = 1.0;
|
||||
vec3 n = grad(p);
|
||||
vec3 rd2 = reflect(rd, n);
|
||||
vec3 ro2 = p + rd2 * 0.1;
|
||||
vec3 p2 = ro2;
|
||||
for (float i = 0.0; i < 256.0; ++i){
|
||||
float d = map(p2);
|
||||
if ( abs (d) < 0.001) {
|
||||
st = i/256.0;
|
||||
break;
|
||||
}
|
||||
p2 += rd2 * 2.0 *d * i / 256.0;
|
||||
}
|
||||
color += mix(vec3(0.4,1.0,0.6) * st, vec3(1.0), 0.01 * distance(ro, p2));
|
||||
}
|
||||
|
||||
//color = pow(color, vec3(1.0/1.8));
|
||||
out_color = vec4(color, 1.0);
|
||||
}
|
93
2019-11-30/02-ponk.glsl
Normal file
93
2019-11-30/02-ponk.glsl
Normal file
@ -0,0 +1,93 @@
|
||||
#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;
|
||||
|
||||
#define time fGlobalTime
|
||||
|
||||
layout(location = 0) out vec4 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 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
mat2 rot (float a) {
|
||||
float c=cos(a);
|
||||
float s = sin(a);
|
||||
return mat2(c,s,-s,c);
|
||||
}
|
||||
|
||||
#define repeat(p,r) (mod(p,r)-r/2.)
|
||||
|
||||
float map (vec3 p) {
|
||||
p.z = repeat(p.z+time*1., 4.);
|
||||
float scene = 10.;
|
||||
float wave = sin(time*4.)*.5+.5;
|
||||
float wave2 = sin(time*12.)*.5+.5;
|
||||
const float count = 6.;
|
||||
float range = 1.;
|
||||
float a = 1.;
|
||||
float falloff = 1.8;
|
||||
vec3 op = p;
|
||||
for (float i = count; i > 0.; i--) {
|
||||
p.xz *= rot(time*.1);
|
||||
p.yz *= rot(time*.2);
|
||||
p.yx *= rot(time*.3);
|
||||
//p.yx *= rot(sin(time*8.)*.1);
|
||||
p = abs(p)-(range)*a;
|
||||
scene = min(scene, length(p.xy)-(.4-.01*wave2)*a);
|
||||
scene = min(scene, length(p)-(.9-.01*wave2)*a);
|
||||
a /= falloff;
|
||||
}
|
||||
scene = abs(scene) - .001;
|
||||
scene = max(scene, -length(op.xy)+.4);
|
||||
return scene;
|
||||
}
|
||||
|
||||
vec3 getNormal (vec3 p) {
|
||||
vec2 e = vec2(.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);
|
||||
float wave = sin(time*8.)*.5+.5;
|
||||
vec3 ray = normalize(vec3(uv,.3));
|
||||
ray.xz *= rot(sin(time*.6)*.2);
|
||||
ray.yz *= rot(sin(time*.3)*.1);
|
||||
vec3 pos = eye;
|
||||
float shade = 0.;
|
||||
const float count = 40.;
|
||||
for (float index = count; index > 0.; index--) {
|
||||
float d = map(pos);
|
||||
if (d < 0.01) {
|
||||
shade = (index / count);
|
||||
break;
|
||||
}
|
||||
pos += ray * d;
|
||||
}
|
||||
vec3 normal = getNormal(pos);
|
||||
//color.rgb = normal * .5 + .5;
|
||||
color.rgb += vec3(.2,.8,.9) * clamp(dot(normal, -ray), 0., 1.);
|
||||
color.rgb += vec3(2) * pow(clamp(dot(normal, vec3(0,0,-1))*.5+.5, 0., 1.), 24.);
|
||||
color *= shade;
|
||||
}
|
71
2019-11-30/03-franzybily.glsl
Normal file
71
2019-11-30/03-franzybily.glsl
Normal file
@ -0,0 +1,71 @@
|
||||
#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 RND(float n){
|
||||
|
||||
float r = sin(n+12345.67)+sin(n*4.+3256.);
|
||||
return fract(r);
|
||||
|
||||
}
|
||||
|
||||
float randd(float n){
|
||||
|
||||
float c = fract(n);
|
||||
return mix(RND(n),RND(n+1),c);
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
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 *= 2.;
|
||||
float t = fGlobalTime*2.;
|
||||
t = floor(t) + smoothstep(0.,1.,fract(t));
|
||||
|
||||
|
||||
float V = 0.;
|
||||
vec3 C = vec3(0);
|
||||
int count = 10;
|
||||
for(int i = 0; i<count;i++){
|
||||
|
||||
|
||||
float gil = sin(t+uv.x+i)*0.5;
|
||||
|
||||
|
||||
float nusan = gil + sin(i*2.23+t)+cos(uv.x + t*2.2);
|
||||
float r = randd(uv.x+t+uv.y);
|
||||
float width = 0.05+r*0.05 + (sin(t*4.)*fract(uv.x)*0.5+0.5)*0.2;
|
||||
float S1 = step(nusan + width,uv.y-i*0.01);
|
||||
float S2 = step(nusan - width,uv.y);
|
||||
V += S2-S1;
|
||||
C += vec3(sin(V)*0.02,cos(V*0.02)*0.1,0.);
|
||||
C += RND(t*10.+i)*0.02 ;
|
||||
|
||||
|
||||
}
|
||||
float flopine = 0.;
|
||||
C = vec3(1.)-C;
|
||||
C = pow(C,vec3(5.2));
|
||||
|
||||
out_color = vec4(C.rrr,1.);
|
||||
}
|
91
2019-11-30/04-col1.glsl
Normal file
91
2019-11-30/04-col1.glsl
Normal file
@ -0,0 +1,91 @@
|
||||
#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
|
||||
|
||||
vec3 repeat(vec3 v, float c) {
|
||||
return mod(v, c) - c / 2.0;
|
||||
}
|
||||
|
||||
float putaindebass() {
|
||||
return texture(texFFTIntegrated, 0.1).r;
|
||||
}
|
||||
|
||||
vec2 rotate2d(vec2 p, float a) {
|
||||
return mat2(
|
||||
sin(a), -cos(a),
|
||||
cos(a), -sin(a)
|
||||
) * p;
|
||||
}
|
||||
|
||||
float sphere(vec3 pos, float radius) {
|
||||
return length(pos) - radius;
|
||||
}
|
||||
|
||||
float plane(vec3 pos) {
|
||||
return pos.y;
|
||||
}
|
||||
|
||||
float map(vec3 pos) {
|
||||
//float scene = 10000.0;
|
||||
|
||||
//scene = plane(pos);
|
||||
|
||||
pos.xz = rotate2d(pos.xy, sin(pos.z * 0.005 + fGlobalTime * 0.5) * 0.5);
|
||||
//pos.xz = rotate2d(pos.xy, sin(pos.z * 0.01));
|
||||
|
||||
pos = repeat(pos, 10.0);
|
||||
|
||||
|
||||
float scene = sphere(pos, 2.0);
|
||||
return scene;
|
||||
}
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec2 uv = gl_FragCoord.xy / v2Resolution;
|
||||
uv = uv * 2.0 - 1.0;
|
||||
uv.x *= v2Resolution.x / v2Resolution.y;
|
||||
|
||||
vec3 ro = vec3(sin(fGlobalTime), sin(fGlobalTime * 0.1), putaindebass() * 50.0);
|
||||
vec3 pos = ro;
|
||||
vec3 dir = normalize(vec3(uv, 1.4));
|
||||
|
||||
const float count = 256.0;
|
||||
|
||||
vec3 color = vec3(0.0);
|
||||
|
||||
for(float i = 0; i < count; i++) {
|
||||
float d = map(pos);
|
||||
|
||||
if(d < 0.01) {
|
||||
color = vec3(1.0);
|
||||
|
||||
color = 1.0 - vec3(i / count);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
pos += d * dir;
|
||||
}
|
||||
|
||||
float fog = length(pos - ro) * 0.0065;
|
||||
|
||||
color *= 1.0 - fog;
|
||||
|
||||
|
||||
out_color = vec4(color, 1.0);
|
||||
}
|
86
2019-11-30/05-gaxil.dx11.hlsl
Normal file
86
2019-11-30/05-gaxil.dx11.hlsl
Normal file
@ -0,0 +1,86 @@
|
||||
Texture2D texChecker;
|
||||
Texture2D texNoise;
|
||||
Texture2D texTex1;
|
||||
Texture2D texTex2;
|
||||
Texture2D texTex3;
|
||||
Texture2D texTex4;
|
||||
Texture1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
|
||||
Texture1D texFFTSmoothed; // this one has longer falloff and less harsh transients
|
||||
Texture1D texFFTIntegrated; // this is continually increasing
|
||||
SamplerState smp;
|
||||
#define time fGlobalTime
|
||||
|
||||
cbuffer constants
|
||||
{
|
||||
float fGlobalTime; // in seconds
|
||||
float2 v2Resolution; // viewport resolution (in pixels)
|
||||
}
|
||||
|
||||
float4 plas( float2 v, float time )
|
||||
{
|
||||
float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 );
|
||||
return float4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );
|
||||
}
|
||||
|
||||
float getHash(float2 pos)
|
||||
{
|
||||
return frac(sin(floor((pos.x)*1258.8)*896) + sin(floor(pos.y*876.7623))*456);
|
||||
}
|
||||
|
||||
float getNoise(float2 pos)
|
||||
{
|
||||
float2 fPos = frac(pos);
|
||||
float2 iPos = floor(pos);
|
||||
|
||||
return lerp(
|
||||
lerp(getHash(iPos) , getHash(iPos+float2(1,0)), fPos.x),
|
||||
lerp(getHash(iPos+float2(0,1)), getHash(iPos+float2(1,1)), fPos.x), fPos.y);
|
||||
}
|
||||
|
||||
float getMNoise(float2 pos)
|
||||
{
|
||||
float val=0.0f;
|
||||
float it = 1.0f;
|
||||
|
||||
for(int i=0;i<4; i++)
|
||||
{
|
||||
val += getNoise(pos)*it;
|
||||
pos *= 2.0f;
|
||||
it *=0.5f;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
float2x2 rot(float angle)
|
||||
{
|
||||
return float2x2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
||||
}
|
||||
|
||||
|
||||
float4 main( float4 position : SV_POSITION, float2 TexCoord : TEXCOORD ) : SV_TARGET
|
||||
{
|
||||
float2 uv = TexCoord;
|
||||
uv -= 0.5;
|
||||
uv /= float2(v2Resolution.y / v2Resolution.x, 1);
|
||||
|
||||
float2 oUV = uv;
|
||||
|
||||
float r = getMNoise(uv*8);
|
||||
|
||||
uv = mul(rot(r+time),uv);
|
||||
uv = abs(uv);
|
||||
uv.x += frac(time*.5);
|
||||
|
||||
uv = mul(rot(time*2.2), uv);
|
||||
|
||||
float4 col;
|
||||
col.r = getMNoise(uv*4);
|
||||
col.g = getMNoise(uv*4.5);
|
||||
col.b = getMNoise(uv*5);
|
||||
col.a = 1;
|
||||
|
||||
col *= smoothstep(-0.5, 0, oUV.y);
|
||||
col *= smoothstep(0.5, 0, oUV.y);
|
||||
|
||||
return col;
|
||||
}
|
135
2019-11-30/06-lsdlive.glsl
Normal file
135
2019-11-30/06-lsdlive.glsl
Normal file
@ -0,0 +1,135 @@
|
||||
#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 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 re(float p,float d){return mod(p-d*.5,d)-d*.5;}
|
||||
|
||||
void mo(inout vec2 p,vec2 d){
|
||||
p=abs(p)-d;
|
||||
if(p.y>p.x)p=p.yx;
|
||||
}
|
||||
|
||||
|
||||
void amod(inout vec2 p,float a){
|
||||
float m=re(atan(p.x,p.y),a);
|
||||
p = vec2(cos(m),sin(m))*length(p);
|
||||
}
|
||||
|
||||
|
||||
float g;
|
||||
float g1;
|
||||
float de(vec3 p){
|
||||
// p.xz*=r2d(time);
|
||||
//p.xy*=r2d(time*.5);
|
||||
|
||||
p.z=re(p.z,1.5
|
||||
);
|
||||
|
||||
|
||||
p.x=abs(p.x)-2.;
|
||||
p.xy*=r2d(time);
|
||||
|
||||
amod(p.xy, 6.28/5.);
|
||||
|
||||
//p.xy*=r2d(p.z*.5);
|
||||
//p.x=abs(p.x)-8.;
|
||||
|
||||
|
||||
vec3 q=p;
|
||||
//p.xy*=r2d(p.z*.3);
|
||||
p.x=abs(p.x)-4;
|
||||
amod(p.xy, 6.28/7.);
|
||||
mo(p.xz, vec2(1, 2));
|
||||
mo(p.xy, vec2(1.2, 2.));
|
||||
amod(p.xy, 6.28/3.);
|
||||
p.xy*=r2d(p.z*.3);
|
||||
p.x = abs(p.x) - 1;
|
||||
p.xy*=r2d(3.14*.25);
|
||||
|
||||
float d1 = sc(p,.2);
|
||||
|
||||
g1+=.01/(.01+d1*d1);
|
||||
|
||||
|
||||
p=q;
|
||||
|
||||
re(p.z,2.);
|
||||
amod(p.xy, 6.28/8.);
|
||||
mo(p.xy, vec2(7));
|
||||
amod(p.xy, 6.28/3.);
|
||||
mo(p.xy, vec2(1, 2));
|
||||
float d2 = dot(p,normalize(sign(p)))-.5;
|
||||
|
||||
float d = min(d2,d1);
|
||||
|
||||
|
||||
g+=.01/(.01+d2*d2);
|
||||
|
||||
p=q;
|
||||
|
||||
p.xy*=r2d(p.z*.1);
|
||||
p.x=abs(p.x)-8.;
|
||||
d = min(d,length(p.xy)-1.);
|
||||
g+=.01/(.01+d2*d2);
|
||||
|
||||
return d;
|
||||
|
||||
return length(p)-.5 - sin(time);
|
||||
}
|
||||
|
||||
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*=sin(time);
|
||||
uv*=r2d(time*2);
|
||||
|
||||
|
||||
vec3 ro=vec3(0,0,-3 + time * 12.),rd=normalize(vec3(uv,.3-length(uv) + tan(sin(time*2.)))),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),.001);
|
||||
t+=d*.3;
|
||||
}
|
||||
vec3 c=mix(vec3(.9, .3, .2), vec3(.4,.12,.1), length(7.*uv.x)+i);
|
||||
|
||||
c+=g*.04;
|
||||
c+=g1*.1*vec3(.1, .5, .5);
|
||||
out_color = vec4(c,1);
|
||||
}
|
53
2019-11-30/07-monollonom-bg.glsl
Normal file
53
2019-11-30/07-monollonom-bg.glsl
Normal file
@ -0,0 +1,53 @@
|
||||
#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;
|
||||
#define time fGlobalTime
|
||||
|
||||
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 circle(vec2 uv, float id) {
|
||||
return smoothstep(length(uv - 0.5), cos(time * 5 + id) * 0.1 + 0.2, cos(time * 5 + id) * 0.1 + 0.21);
|
||||
}
|
||||
void main(void)
|
||||
{
|
||||
// on connait rien en shader
|
||||
// soyez sympa
|
||||
// on est deux parce que...
|
||||
|
||||
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 += sin(time);
|
||||
uv += vec2(cos(time * 0.1), 0.0);
|
||||
float angle = time * 0.1;
|
||||
mat2 autreTruc = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));
|
||||
|
||||
uv *= autreTruc;
|
||||
|
||||
// il est sympa il nous aide
|
||||
vec2 truc = floor(uv * 10);
|
||||
float id = dot(truc, vec2(1.0, 5.0));
|
||||
uv = fract(uv * 10);
|
||||
|
||||
// on est chaud
|
||||
out_color = vec4(circle(uv, id), circle(uv, id), circle(uv, id) * cos(time) * .5 + .5, 1.0);
|
||||
out_color = 1.0 - out_color;
|
||||
}
|
43
2019-11-30/08-hotdogstudio.glsl
Normal file
43
2019-11-30/08-hotdogstudio.glsl
Normal file
@ -0,0 +1,43 @@
|
||||
#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 );
|
||||
}
|
||||
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 = fract(uv.x * uv.y * 30.);
|
||||
uv.y = fract(uv.x * uv.y * 20.);
|
||||
|
||||
vec4 tex = texture(texNoise, uv);
|
||||
|
||||
float d = length(uv * sin(fGlobalTime)) - 0.5;
|
||||
|
||||
if (d < 0) {
|
||||
tex = 1. - tex;
|
||||
} else {
|
||||
tex = vec4(0.0);
|
||||
}
|
||||
|
||||
out_color = tex;
|
||||
}
|
73
2019-11-30/09-balec-aldwin.dx11.hlsl
Normal file
73
2019-11-30/09-balec-aldwin.dx11.hlsl
Normal file
@ -0,0 +1,73 @@
|
||||
Texture2D texChecker;
|
||||
Texture2D texNoise;
|
||||
Texture2D texTex1;
|
||||
Texture2D texTex2;
|
||||
Texture2D texTex3;
|
||||
Texture2D texTex4;
|
||||
Texture1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
|
||||
Texture1D texFFTSmoothed; // this one has longer falloff and less harsh transients
|
||||
Texture1D texFFTIntegrated; // this is continually increasing
|
||||
SamplerState smp;
|
||||
|
||||
cbuffer constants
|
||||
{
|
||||
float fGlobalTime; // in seconds
|
||||
float2 v2Resolution; // viewport resolution (in pixels)
|
||||
}
|
||||
|
||||
float4 plas( float2 v, float time )
|
||||
{
|
||||
float c = 0.5 + sin( v.x * 10.0 ) + cos( sin( time + v.y ) * 20.0 );
|
||||
return float4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );
|
||||
}
|
||||
|
||||
float Spaget(float2 pos, float offset)
|
||||
{
|
||||
|
||||
float2 uvPos = 0.5 + float2(sin(pos.x * 6.28f)*0.03, cos(pos.x * 6.28f)*0.03);
|
||||
|
||||
float val = texNoise.Sample(smp, uvPos+float2(0.0f, offset));
|
||||
// float val = texNoise.Sample(smp, float2(pos.x, 0.0f));
|
||||
|
||||
return val;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
float4 main( float4 position : SV_POSITION, float2 TexCoord : TEXCOORD ) : SV_TARGET
|
||||
{
|
||||
float2 uv = TexCoord;
|
||||
uv -= 0.5;
|
||||
|
||||
uv /= float2(v2Resolution.y / v2Resolution.x, 1);
|
||||
|
||||
float4 col1 = float4(0.1, 0.3, 0.6, 1);
|
||||
float4 col2 = float4(0.8, 0.2, 0.1, 1);
|
||||
|
||||
float4 col=col1;
|
||||
|
||||
// col = lerp(col, float4(0.8, 0.7, 0.0, 1.0), smoothstep(0.2, 0.3, length(uv));
|
||||
|
||||
|
||||
for (int i=0;i<10;i++)
|
||||
{
|
||||
float2 finalUV = uv + float2(fGlobalTime*(i+3)*0.05, 0.0);
|
||||
finalUV.x *= 0.5;
|
||||
|
||||
float val = Spaget(finalUV, i*0.05)-0.25-i*0.02;
|
||||
val *=2;
|
||||
float3 locColor = lerp(col1, col2, i*0.18);
|
||||
locColor *= smoothstep(-1.0,0.5, uv.y);
|
||||
|
||||
|
||||
|
||||
|
||||
col.rgb = lerp(col.rgb, locColor, (smoothstep(-1,val, uv.y)) * (smoothstep(val+0.15,val+0.145, uv.y)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return col;
|
||||
}
|
Reference in New Issue
Block a user