From 9bd77e54943d954291b5faef287ccca5dcebd7a4 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 00:15:15 -0300 Subject: examples: micscope and spheres come home, as they were, building Both lived outside any repository, beside sketchbook, with manifests that pointed at ../01-drat-meout/lib/sketchbook, which no longer exists. They are copied into examples/micscope and examples/spheres (their sources, shaders, tests, test material and web icons; not their caches, builds, packages, state files or .gitignore, which the root's covers), their manifests depend on "../.." as the other examples do, and their READMEs link sketchbook there. Nothing else changed: both build against today's library and pass their own zig build test (micscope 62/62 steps, 11/11 tests, its transport, record, render and tuner scripts; spheres 75/75 steps, 3/3 tests, its play script). The originals are untouched. micscope's test/reference.flac (3.7 MiB, CC BY-SA 3.0, credited in its test/README.md) is the rendering reference its render script opens. The README lists both examples. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- examples/spheres/shaders/rechord.comp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 examples/spheres/shaders/rechord.comp (limited to 'examples/spheres/shaders/rechord.comp') diff --git a/examples/spheres/shaders/rechord.comp b/examples/spheres/shaders/rechord.comp new file mode 100644 index 0000000..6119120 --- /dev/null +++ b/examples/spheres/shaders/rechord.comp @@ -0,0 +1,27 @@ +#version 450 +#extension GL_GOOGLE_include_directive : require +// The look-ahead's chords again, for another scale setting: one thread per +// snapshot, the first `count` of them. +layout(local_size_x = 64) in; + +#include "LookParams.glsl" +#include "voices.glsl" + +layout(set = 0, binding = 0) readonly buffer Snapshots { vec4 snapshots[]; }; +layout(set = 1, binding = 0) buffer Chords { uint chords[]; }; + +void main() { + uint at = gl_GlobalInvocationID.x; + if (at >= u.count) return; + vec2 p[3]; + vec2 v[3]; + for (int i = 0; i < 3; i++) { + vec4 b = snapshots[3u * at + uint(i)]; + p[i] = b.xy; + v[i] = b.zw; + } + vec4 sung[3]; + vec4 coupled[3]; + sing(p, v, Mapping(u.base, u.speed_ref, u.depth_scale, u.couple_scale, u.quantize), sung, coupled); + chords[at] = chordOf(sung) | voicing(sung, coupled); +} -- cgit v1.3