From b289d2d4c313f180c31ed34babc7aa8b728212d3 Mon Sep 17 00:00:00 2001 From: Aaron Fenyes Date: Sun, 8 Sep 2024 23:31:48 -0700 Subject: [PATCH] Distinguish odd layer counts in debug mode The low-curvature construction admits odd layer counts. --- app-proto/inversive-display/src/inversive.frag | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app-proto/inversive-display/src/inversive.frag b/app-proto/inversive-display/src/inversive.frag index c6fed13..2e185a5 100644 --- a/app-proto/inversive-display/src/inversive.frag +++ b/app-proto/inversive-display/src/inversive.frag @@ -193,15 +193,13 @@ void main() { if (debug_mode) { // at the bottom of the screen, show the color scale instead of the // layer count - if (gl_FragCoord.y < 10.) layer_cnt = 2 * int(8. * gl_FragCoord.x / resolution.x); + if (gl_FragCoord.y < 10.) layer_cnt = int(16. * gl_FragCoord.x / resolution.x); // convert number to color - vec3 color; - if (layer_cnt % 2 == 0) { - ivec3 bits = layer_cnt / ivec3(2, 4, 8); - color = mod(vec3(bits), 2.); - } else { - color = vec3(0.5); + ivec3 bits = layer_cnt / ivec3(1, 2, 4); + vec3 color = mod(vec3(bits), 2.); + if (layer_cnt % 16 >= 8) { + color = mix(color, vec3(0.5), 0.5); } outColor = vec4(color, 1.); return;