Both phases come out of the manual gate — watching whole tracks — and both
fix something no automated check was looking for.
Phase 8: shots. A section is a STAGE of the song and can run ninety
seconds; one scene held that long reads as a still image with a wobble on
it. Each section kind now gets a roster of three or four stage visuals
instead of one scene, and each section is cut into shots that rotate
between them on phrase lines, never holding past 22s. The roster stays per
kind, so a track's drops still cut between the same images and the video
keeps its identity; the anchor opens each section and the rotation returns
to it, and when a companion is due it is the least recently shown one.
The arc driver stopped working in sections and started working in cues, one
per shot, so a shot cut and a section change take the same code path and
differ only in transition length. The default transition is a slow
dissolve — two bars calm, one loud; a straight cut is reserved for
sections above the energy threshold, because on calm material a cut reads
as a glitch rather than as an edit.
Phase 9: production design. With cuts every fifteen seconds the next
problem was that the images being cut between shared nothing but the
palette. What a music video actually shares across shots is a location, a
cast, a camera operator and an art direction, so each track now generates a
personality in four traits (shape, camera, space, style) off the look seed.
The traits reach shaders as uniforms plus four helpers in the contract, and
each scene expresses them its own way: Classic Wave's rings take the
signature polygon, Metaballs merge as one, Floating Geometry no longer
picks between a box and a circle because the production already decided.
The part that makes it a design rather than a filter: scenes DECLARE which
traits they honour, a track is built on one or two, and a scene that does
not honour all of them is not cast in that track. The library shrinks per
track on purpose.
Two gates keep the declaration honest — lint greps each shader for evidence
of every trait it claims, and a render check measures that each declared
trait actually moves the image (41 scene/trait pairs, weakest response 64
of 255). A layer with no personality renders bit-identically to before,
which is what keeps every earlier sweep and regression valid.
Checks changed rather than added:
- P4 scene-change and drift checks now measure per shot, not per section;
the crossfade check reads its length off the cue.
- P5 flash sweep runs per shot, so the visuals that only appear
mid-section are measured too.
- P6 preview/export parity primes first (as both real paths do) and
compares at the one-LSB tolerance Phase 7 already uses. Measured over
four consecutive shows: 3 frames at delta 1, then bit-exact — GPU
variance on first render, not a divergence.
- P2's contract-uniform list is derived from the contract instead of
retyped, so the signature uniforms cannot fall out of sync.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
74 lines
2.9 KiB
JavaScript
74 lines
2.9 KiB
JavaScript
// Geometric family: two rotating line grids interfering.
|
|
//
|
|
// Moiré is a spatial-aliasing effect by nature, so this scene is the most likely
|
|
// in the library to alias badly. Line width is held above a floor and scaled by
|
|
// u_pixelScale, which is what keeps a 720p preview and a 4K export looking the
|
|
// same rather than the preview shimmering.
|
|
|
|
export const moireGrid = {
|
|
name: 'Moiré Grid',
|
|
family: 'geometric',
|
|
kind: 'fragment',
|
|
// Personality: see look/Personality.js.
|
|
traits: ['camera', 'style'],
|
|
|
|
params: {
|
|
density: { type: 'float', range: [6, 60], default: 22, uniform: 'u_density', bias: 'density' },
|
|
offset: { type: 'float', range: [0.0, 0.5], default: 0.08, uniform: 'u_offset' },
|
|
rotate: { type: 'float', range: [0, 0.25], default: 0.04, uniform: 'u_rotate', bias: 'motion', rate: true },
|
|
// Named u_lineWidth, not u_width: the shader contract already declares
|
|
// `uniform float u_width` for stereo width, and a colliding name is a
|
|
// redefinition error that renders the scene as a black frame.
|
|
width: { type: 'float', range: [0.06, 0.5], default: 0.2, uniform: 'u_lineWidth' },
|
|
warp: { type: 'float', range: [0, 1], default: 0.25, uniform: 'u_warp' },
|
|
glow: { type: 'float', range: [0, 1.2], default: 0.35, uniform: 'u_glow', bias: 'energy' },
|
|
palette: { type: 'palette', count: 4 },
|
|
},
|
|
|
|
reactive: {
|
|
offset: { feature: 'bandLow', amount: 0.35 },
|
|
glow: { feature: 'beat', amount: 0.35, response: 'spike' },
|
|
warp: { feature: 'flux', amount: 0.2, response: 'smooth' },
|
|
},
|
|
|
|
shader: `
|
|
// Anti-aliased line grid: the smoothstep edge is widened by the screen-space
|
|
// derivative, so lines stay a consistent visual weight at any resolution.
|
|
float grid(vec2 q, float density, float width) {
|
|
vec2 g = q * density;
|
|
vec2 f = abs(fract(g) - 0.5);
|
|
float d = min(f.x, f.y);
|
|
float aa = max(fwidth(d), 0.001);
|
|
return smoothstep(width * 0.5 + aa, width * 0.5 - aa, d);
|
|
}
|
|
|
|
vec4 scene(vec2 uv, vec2 p) {
|
|
float t = u_time * u_rotate + u_seed;
|
|
p = sigFolded(sigCamera(p));
|
|
|
|
vec2 warp = vec2(fbm(p * 1.5 + t, 3), fbm(p * 1.5 - t, 3)) - 0.5;
|
|
vec2 q = p + warp * u_warp;
|
|
|
|
// Drawn in the track's hand: its line weight scales this scene's.
|
|
float weight = u_lineWidth * (0.5 + u_sigLine);
|
|
float a = grid(rot(t * 6.28318530718) * q, u_density, weight);
|
|
float b = grid(rot(-t * 6.28318530718 + u_offset * 3.14159) * (q + u_offset), u_density, weight);
|
|
|
|
// The interference term is the point: where both grids land, it peaks.
|
|
float interference = a * b;
|
|
float either = max(a, b);
|
|
|
|
vec3 col = pal(0) * 0.05;
|
|
col += pal(1) * either * 0.35;
|
|
col += pal(2) * interference * (0.8 + u_glow);
|
|
col += pal(3) * pow(interference, 3.0) * u_glow;
|
|
|
|
col *= 0.6 + 0.4 * exp(-dot(p, p) * 0.3);
|
|
col += sigGrain(uv);
|
|
return vec4(col, 1.0);
|
|
}
|
|
`,
|
|
};
|
|
|
|
export default moireGrid;
|