Synesthesia fun.syn.live
Contribute GitHub
esc
11 entries · newest first
Minimal raymarcher in a .synScene WRITE-UP

The wiring a first Syn raymarcher actually needs — map()/getNorm/getLight/renderMain — with the distance functions credited to Inigo Quilez and the lighting scaffold self-forked from a personal Shadertoy.

#raymarching#3d#sdf
@UFFFD AUG 4 · 4 min read
LastClick FUNCTION JS

Tracks the previous frame's click position so you can compute a per-frame drag delta — the basis for orbit-camera and paint-style mouse interaction in a .synScene.

#mouse#interaction#javascript
@UFFFD JUL 30
opRepeat (bounded) FUNCTION GLSL

Domain repetition clamped to a [lima, limb) range instead of tiling forever, for repeated SDF patterns that stop at scene bounds.

#sdf#raymarching#domain-repetition
@UFFFD JUL 30
polar / cart FUNCTION GLSL

Round-trip between cartesian and polar (angle, radius) coordinates — the inverse-included counterpart to the built-in _toPolar.

#math#coordinates#kaleidoscope
@UFFFD JUL 30
Randomization helpers SNIPPET JS

Weighted and unweighted random pickers for scene variation — including an exponential pick that favors the front of the list, for "usually subtle, occasionally wild" parameter choices.

#random#javascript#variation
@UFFFD JUL 30
rot FUNCTION GLSL

2D rotation matrix. Returns a mat2 so you can rotate a coordinate plane in place with p.xy *= rot(a), rather than transforming a point like _rotate does.

#math#rotation
@UFFFD JUL 30
GLSL math helpers for script.js SNIPPET JS

mix, smoothstep and normalized sin re-implemented for script.js, where the GLSL builtins you're used to don't exist.

#math#interpolation#javascript
@UFFFD JUL 30
SynthTime FUNCTION JS

Gives each time-driven effect a large random seed offset so multiple noise channels don't visibly sync up or spike together.

#time#noise#audio-reactivity
@UFFFD JUL 30
looper SNIPPET GLSL

A 0→1 ramp that resets exactly on a musical bar boundary, the backbone of seamless tempo-synced loops.

#time#loop#tempo
@UFFFD JUN 14
admix / abmix FUNCTION GLSL

In-place mix() wrappers that nudge a value toward a target without restating its name every line.

#color#mix#utility
@UFFFD JUN 12
nearly FUNCTION GLSL

Approximate float equality, comparing computed values without exact-match fragility.

#math#utility
@UFFFD JUN 10