pretty debug info and windowed mode
This commit is contained in:
+33
-2
@@ -805,8 +805,6 @@ float write_int(vec2 uv, vec2 pos, int value, int magnitude)
|
||||
if (i == 0 || value >= m) {
|
||||
d += char_at(uv, pos + vec2(magnitude - i - 1, 0), int(0x30 + (value % (m * 10)) / m));
|
||||
m *= 10;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return d;
|
||||
@@ -1254,12 +1252,20 @@ subroutine(src_stage_sub) vec4 src_16(vec2 vUV, int seed)
|
||||
|
||||
// logic
|
||||
|
||||
const int texts[3][5] = {
|
||||
{0x46, 0x50, 0x53, 0x00, 0x00}, // FPS
|
||||
{0x54, 0x45, 0x4D, 0x50, 0x4F}, // TEMPO
|
||||
{0x54, 0x49, 0x4D, 0x45, 0x00}, // TIME
|
||||
};
|
||||
|
||||
vec2 uv2 = uv1;
|
||||
|
||||
uv2 *= 10;
|
||||
uv2.x -= 0.5;
|
||||
uv2.y += 0.5;
|
||||
|
||||
vec2 uv3 = uv1 * 30;
|
||||
|
||||
// base frame
|
||||
float f =
|
||||
h_rect(uv2, vec2(-5, -2), vec2(1), 0.1) +
|
||||
@@ -1316,7 +1322,32 @@ subroutine(src_stage_sub) vec4 src_16(vec2 vUV, int seed)
|
||||
// show mix
|
||||
f += char_at(uv2, vec2(1.55, -0.6), mix_type > 0 ? 0x4B : 0x4D);
|
||||
f = mix(f, 1 - f, rect(uv2, vec2(2, -0.9 + 0.9 * mix_value), vec2(0.9, 0.9 * mix_value)));
|
||||
|
||||
// show debug info
|
||||
float v = 0;
|
||||
float x = 0;
|
||||
|
||||
x = -15;
|
||||
f += write_5(uv3, vec2(x,13), texts[0]);
|
||||
f += write_int(uv3, vec2(x - 4,13), iFPS, 3);
|
||||
v = min(1, iFPS/60.0);
|
||||
f += h_rect(uv3, vec2(x, 12), vec2(4, 0.5), 0.2);
|
||||
f += rect(uv3, vec2(x + 4 * v - 4, 12), vec2(4 * v, 0.4));
|
||||
|
||||
x = 0;
|
||||
f += write_5(uv3, vec2(x,13), texts[1]);
|
||||
f += write_int(uv3, vec2(x - 4,13), int(iTempo), 3);
|
||||
v = modTime(1);
|
||||
f += h_rect(uv3, vec2(x, 12), vec2(4, 0.5), 0.2);
|
||||
f += rect(uv3, vec2(x + 4 * v - 4, 12), vec2(4 * v, 0.4));
|
||||
|
||||
x = 15;
|
||||
f += write_5(uv3, vec2(x,13), texts[2]);
|
||||
f += write_int(uv3, vec2(x - 6,13), int(iTime), 5);
|
||||
v = fract(iTime);
|
||||
f += h_rect(uv3, vec2(x, 12), vec2(4, 0.5), 0.2);
|
||||
f += rect(uv3, vec2(x + 4 * v - 4, 12), vec2(4 * v, 0.4));
|
||||
|
||||
return vec4(f);
|
||||
}
|
||||
|
||||
|
||||
+1
-13
@@ -9,7 +9,7 @@ float s(vec2 uv, float x0, float y0) {
|
||||
step(-y0 - 1, -uv.y);
|
||||
}
|
||||
|
||||
const int texts[11][5] = {
|
||||
const int texts[8][5] = {
|
||||
{0x49, 0x4E, 0x20, 0x41, 0x00}, // IN A
|
||||
{0x49, 0x4E, 0x20, 0x42, 0x00}, // IN B
|
||||
{0x53, 0x52, 0x43, 0x20, 0x41}, // SRC A
|
||||
@@ -18,9 +18,6 @@ const int texts[11][5] = {
|
||||
{0x46, 0x58, 0x20, 0x42, 0x00}, // FX B
|
||||
{0x41, 0x2B, 0x42, 0x00, 0x00}, // A+B
|
||||
{0x4D, 0x46, 0x58, 0x00, 0x00}, // MFX
|
||||
{0x46, 0x50, 0x53, 0x00, 0x00}, // FPS
|
||||
{0x54, 0x45, 0x4D, 0x50, 0x4F}, // TEMPO
|
||||
{0x54, 0x49, 0x4D, 0x45, 0x00}, // TIME
|
||||
};
|
||||
|
||||
void main() {
|
||||
@@ -54,14 +51,5 @@ void main() {
|
||||
t += write_5(uv3, vec2(-17,8), texts[6]);
|
||||
t += write_5(uv3, vec2(19,8), texts[7]);
|
||||
|
||||
t += write_5(uv3, vec2(-23,8), texts[8]);
|
||||
t += write_int(uv3, vec2(-27,8), iFPS, 3);
|
||||
|
||||
t += write_5(uv3, vec2(-23,6), texts[9]);
|
||||
t += write_int(uv3, vec2(-27,6), int(iTempo), 3);
|
||||
|
||||
t += write_5(uv3, vec2(-23,4), texts[10]);
|
||||
t += write_int(uv3, vec2(-29,4), int(iTime), 5);
|
||||
|
||||
fragColor = mix(c, 1 - c, t);
|
||||
}
|
||||
Reference in New Issue
Block a user