syncit ei toimi

This commit is contained in:
Teemu Järvisalo
2025-07-23 22:57:27 +03:00
parent f460f71ab4
commit d33042e30a
4 changed files with 88 additions and 108 deletions

View File

@ -4,8 +4,8 @@ out vec4 o;
const float PI = 3.14159265;
const float TAU = (2. * PI);
const float PHI = sqrt(5.) * 0.5 + 0.5;
layout(location = 0) uniform float syncs[7];
layout(location = 8) uniform float fft_output[512]; // FFT_SIZE / 4
layout(location = 0) uniform float syncs[12];
layout(location = 20) uniform float fft_output[512]; // FFT_SIZE / 4
layout(location = 600) uniform vec3 shapes[15]; // shapes - x = horizontal position, y = vertical position, z = length
layout(location = 700) uniform vec3 test; // shapes test
float u_time = syncs[0];
@ -67,11 +67,7 @@ vec2 opU( vec2 d1, vec2 d2 )
return (d1.x<d2.x) ? d1 : d2;
}
float sdSphere(vec3 p, float r){
return length(p) -r;
}
float opU( float d1, float d2 ) { return -max( -d1, -d2 ); }
// float opU( float d1, float d2 ) { return -max( -d1, -d2 ); }
vec2 mapScene(in vec3 p) {
@ -116,21 +112,10 @@ vec2 mapScene(in vec3 p) {
res = opU(res, vec2(a, 2.));
}
}
res = opU( res, vec2( sdSphere(p-vec3(-2.0,4., 0.0), 2. ), 1.));
*/
// main note effect shapes
a = sdSphere(vec3(p.x + test.y, p.y + test.x, p.z), test.z + 2.);
d = min(d, a);
if (d == a) {
mat = 1.;
}
res = opU( res, vec2( sdSphere(p- vec3(2.0 + test.x, 4. + test.y, 0.0), 2. ), 1.));
return res;
}
@ -268,11 +253,11 @@ vec3 shading(vec3 v, vec3 n, vec3 dir, float material) {
}
vec3 lights = vec3(0.);
lights += addPointLight(vec3(0., 40.0, -10.), vec3(0.77, 0.26, 0.73), 3.0, v, dir, n, shininess);
lights += addPointLight(vec3(0., 2.0, -5.0), vec3(0.08, 0.62, 0.75), 3.0, v, dir, n, shininess);
lights += addPointLight(vec3(0., 40.0, -10.), vec3(0.77, 0.26, 0.73), 30.0, v, dir, n, shininess);
lights += addPointLight(vec3(0., 6.0, -5.0), vec3(0.08, 0.62, 0.75), 20.0, v, dir, n, shininess);
//lights += addPointLight(vec3(0., 25.0, 0.0), vec3(0.5137, 0.1961, 0.7725), 3.0, v, dir, n, shininess);
lights += addPointLight(vec3(0., 20.0, 15.), vec3(0.77, 0.26, 0.73), 3.0, v, dir, n, shininess);
lights += addPointLight(vec3(0., 20.0, 15.), vec3(0.77, 0.26, 0.73), 30.0, v, dir, n, shininess);
vec3 lightDir = vec3(0., 1., -3);
//float sun_dif = clamp(dot(n, lightDir), 0., 1.);