The VJ's EFFECT surface is a small renderer of its own. An effect is a
`.splash` DOCUMENT — engine choice, stages, fields, parameters and now the
SHADERS THEMSELVES live in the document rather than in Rust. That is the
shape this commit introduces (dev has never seen an intermediate one): a
document is the whole effect, and the Rust side is the engine families that
documents draw with.
The engine families: particles and emitters, GPU sim swarms and fluid, static
meshes (firefly synchrony, harmonograph loom, domino liturgy), tiles, flock,
clouds, city, pipes, stock charts, an SDF raymarcher with a subclassable
`scene_sdf`, and a mountain-jet endless range with a beat-pulsed fighter.
Three things make them a system rather than a demo reel:
- SIM FIELDS — a float simulation-texture primitive, so an engine can carry
GPU state across frames (wind, particles, fluid) instead of being a pure
function of the clock.
- CONTENT COUPLING — `content:` in a document and `input0` on every engine's
tex0, so an effect can consume the program video: drapes, backdrops,
mirrors, billboards, chrome, frescoes, canopy, glass, silk, wall, swarm,
pen and mosaic families all take the picture playing behind them.
- MUSIC BINDING — shaders read the beat, so the whole library moves with the
track rather than on its own clock.
Roughly a hundred seeded preset documents ship with it, each with a lazily
rendered animated thumbnail (rendered 4x and box-downscaled, 16-tap SSAA);
the thumbnail pass went from four minutes to eleven seconds. CONTRACT.md is
the document contract and its verify recipe; IDEAS.md is the campaign tracker.
68 lines
2.3 KiB
Text
68 lines
2.3 KiB
Text
// TILE LAGOON — the calm ocean-of-tiles: the live content becomes a mosaic
|
|
// raft rolling on a slow swell. Pattern taught here: the tiles engine's
|
|
// "wave" mode tilts every tile with the LOCAL wave slope (the picture
|
|
// glitters like water), and p1 breathes extra amplitude in on the bar so
|
|
// the sea rises and settles once every four beats.
|
|
{
|
|
name: "Tile Lagoon"
|
|
engine: "tiles"
|
|
mode: "wave"
|
|
seed: 5
|
|
|
|
grid: 30
|
|
spread: 8.0
|
|
aspect: 0.66
|
|
gap: 0.05
|
|
amp: 0.42
|
|
freq: 0.9
|
|
|
|
// Gentle pulse; the bar swell is the real motion driver.
|
|
beat_pulse: 0.25
|
|
p1: "0.35 * env(bar)"
|
|
// A faint constant grout shimmer keeps the lattice readable.
|
|
p2: "0.05 + 0.08 * pulse"
|
|
p0: 0.5
|
|
|
|
// PERFORMANCE DIALS — SWELL/GROUT are the engine's own p1/p2 levers
|
|
// (touching one holds its binding above); FOCUS rides the tiltshift
|
|
// focus line directly (p0 0.5 = today's centre).
|
|
dials: [
|
|
{name: "FOCUS", bind: "p0", default: 0.5},
|
|
{name: "SWELL", bind: "p1", default: 0.5},
|
|
{name: "GROUT", bind: "p2", default: 0.5}
|
|
]
|
|
|
|
input0: "test"
|
|
|
|
color_bg: #x061018
|
|
color_a: #x3fd8c8
|
|
color_b: #x1a5f8a
|
|
color_c: #xbdf5ec
|
|
|
|
fog: 0.0
|
|
glow: 1.0
|
|
|
|
stages: [
|
|
{kind: "tiltshift", focus: "p0", width: 0.34, levels: 2},
|
|
{kind: "bloom", threshold: 0.72, strength: 0.8, levels: 3}
|
|
]
|
|
|
|
// THE LOOK LIVES HERE. This block is not a reference to the
|
|
// engine's shader — it IS the pixel math this effect runs.
|
|
// Rewrite it and the effect looks different; everything else
|
|
// (geometry, motion, the content coupling, the beat) keeps
|
|
// working, because the block SUBCLASSES the engine shader.
|
|
// Inputs: t = the mode highlight drive, attr = (shade, edge, stagger, tumble).
|
|
// Signals: self.time_beat (time, beat, phase, pulse),
|
|
// self.sig (bar, bpm, energy, dt), self.user (p0..p3),
|
|
// self.col_a/b/c/bg, self.fog (density, glow, content, -).
|
|
shader: draw.DrawVjFxTiles {
|
|
fx_color: fn(t: float, attr: vec4, content: vec4, cmix: float) -> vec4 {
|
|
let border = attr.y
|
|
let lit = content.xyz * (attr.x * (0.35 + 0.65 * border))
|
|
let glowline = self.col_c.xyz * (1.0 - border)
|
|
* (t + clamp(self.user.z, 0.0, 4.0))
|
|
return vec4((lit + glowline) * self.fog.y, 1.0)
|
|
}
|
|
}
|
|
}
|