direct sound ja parempi syncca

This commit is contained in:
2025-06-24 17:26:50 +03:00
parent 134a85111e
commit cfd6c97f32
7 changed files with 90 additions and 76 deletions

View File

@ -3,29 +3,25 @@ precision mediump float;
out vec4 o;
const float PI = 22./7.;
layout(location = 0) uniform float syncs[7];
float u_time = syncs[0]/44100.;
float u_time = syncs[0];
vec3 render(vec2 uv, float time) {
if (uv.y >= 0.0 && uv.y <= 0.01 ) {
return vec3(abs(syncs[5]));
float pos = syncs[4];
if (uv.x >= pos && uv.x <= pos+0.01 ) {
return vec3(1.);
}
if (uv.y >= -0.21 && uv.y <= -0.2 ) {
return vec3(abs(syncs[6]*1.3));
if (uv.x >= 0.0 && uv.x <= 0.01 ) {
return vec3(abs(syncs[3]*2));
}
return vec3(0.1, 0.2, 0.3);
return vec3(0.1, 0.2, 0.3) * abs(syncs[1]*1.2);
}
void main() {
vec2 u_resolution = vec2(1920,1080);
vec2 qor = gl_FragCoord.xy/u_resolution.xy;
vec2 uv = -1.0+2.0*qor;
uv.x *= uv.x/u_resolution.y;
vec2 uv = gl_FragCoord.xy * 2. / vec2(1920,1080);
vec3 col = render(uv, u_time);
o = vec4(col,1.0);
}