mandelbulb
mandelbulb · sources · schema v1A WebGL2 ray-marched 3D Mandelbulb fractal source that doubles as an audio oscillator. A single full-screen-quad fragment shader marches the power-8 Mandelbulb distance estimate, shades the hit surface with finite-difference normals, diffuse + Phong specular and a soft shadow, tints it with the Hue palette, and emits the render on video_out (4:3, ray-marched internally at half engine resolution — 512x384 at the 1024x768 default — and LINEAR-upscaled). An orbit camera (Zoom dolly + Rot X pitch / Rot Y yaw) frames the bulb; Power morphs the fractal shape and Detail sets the iteration budget (higher = crisper, costlier). Turn SLICE on to bridge into audio: a fixed-size plane (camera-independent) is marched through the bulb's distance field to read its cross-section as a 256-sample wavetable, played as an oscillator on audio_out and shown as a second on-card readout with a draggable yellow select box. Usage: patch a slow LFO into rotate_y_cv (or just leave SPIN on) for a tumbling fractal, modulate power_cv for shape-morphing, and enable SLICE to play the bulb's geometry as an evolving waveform.
the faceplate
inputs
| id | cable | what it does |
|---|---|---|
zoom_cv | cv | Modulates Zoom: a linear-scaled CV dollies the orbit camera toward (higher) or away from the bulb over its 0.3..3 range; affects framing only, not the audio slice. control voltage (CV); modulates zoom (additive offset — ±1 CV sweeps the full range, centered on the knob) |
rotate_x_cv | cv | Modulates Rot X: linear CV sweeps the orbit camera's pitch over -pi..pi. Camera-only, so it never changes the slice waveform on audio_out. control voltage (CV); modulates rotate_x (additive offset — ±1 CV sweeps the full range, centered on the knob) |
rotate_y_cv | cv | Modulates Rot Y: linear CV sweeps the orbit camera's yaw over -pi..pi (added on top of any auto-spin). Camera-only; does not affect the audio slice. control voltage (CV); modulates rotate_y (additive offset — ±1 CV sweeps the full range, centered on the knob) |
power_cv | cv | Modulates Power: linear CV sweeps the fractal exponent over 1..12 (8 = classic bulb), morphing the whole shape. Power is shared by the picture AND the slice, so this also reshapes audio_out when SLICE is on. control voltage (CV); modulates power (additive offset — ±1 CV sweeps the full range, centered on the knob) |
detail_cv | cv | Modulates Detail: linear CV sweeps the fractal iteration budget over 4..30 (discrete). Higher = sharper surface detail at more cost; shared with the slice, so it also affects audio_out when SLICE is on. control voltage (CV); modulates detail (additive offset — ±1 CV sweeps the full range, centered on the knob) |
hue_cv | cv | Modulates Hue: linear CV rotates the palette over 0..1, tinting both the lit surface and the sky background. Color only; no effect on geometry or the audio slice. control voltage (CV); modulates hue (additive offset — ±1 CV sweeps the full range, centered on the knob) |
slice_y_cv | cv | Modulates the slice plane offset (Y): linear CV slides the readout plane along its rotated normal over +/-1.2 fractal units, scanning it through the whole bulb. Drives the audio_out waveform; no effect on the camera view. control voltage (CV); modulates slice_y (additive offset — ±1 CV sweeps the full range, centered on the knob) |
slice_rx_cv | cv | Modulates the slice plane pitch (S Rot X): linear CV rotates the readout plane over -pi..pi about X, re-orienting which cross-section is scanned. Shapes audio_out; camera unaffected. control voltage (CV); modulates slice_rx (additive offset — ±1 CV sweeps the full range, centered on the knob) |
slice_ry_cv | cv | Modulates the slice plane yaw (S Rot Y): linear CV rotates the readout plane over -pi..pi about Y (this is also the horizontal axis of the on-card yellow select box). Shapes audio_out; camera unaffected. control voltage (CV); modulates slice_ry (additive offset — ±1 CV sweeps the full range, centered on the knob) |
slice_rz_cv | cv | Modulates the slice plane roll (S Rot Z): linear CV rotates the readout plane over -pi..pi about Z, spinning the scanned cross-section in its own plane. Shapes audio_out; camera unaffected. control voltage (CV); modulates slice_rz (additive offset — ±1 CV sweeps the full range, centered on the knob) |
outputs
| id | cable | what it does |
|---|---|---|
video_out | mono-video | Mono-video out: the shaded Mandelbulb render (4:3, ray-marched at half engine resolution — 512x384 at the 1024x768 default — and LINEAR-upscaled to the engine output res). Always live; when SCRN is off AND this port is unpatched the raymarch is skipped to save performance. mono video stream |
audio_out | audio | Mono audio out: the bulb's slice cross-section played as a 256-sample wavetable oscillator. Silent unless the SLICE toggle is on (with SLICE off, no audio node exists); driven by the slice_y / slice_rx / slice_ry / slice_rz / Power / Detail controls. audio signal |
params
| id | label | range | default | curve |
|---|---|---|---|---|
zoom | Zoom | 0.3..3 | — | log |
rotate_x | Rot X | ?..? | — | linear |
rotate_y | Rot Y | ?..? | — | linear |
power | Power | 1..12 | — | linear |
detail | Detail | 4..30 | — | discrete |
hue | Hue | 0..1 | — | linear |
autospin | Spin | 0..1 | — | discrete |
screen_on | Screen | 0..1 | — | discrete |
slice | Slice | 0..1 | — | discrete |
slice_y | Y | ?..? | — | linear |
slice_rx | S Rot X | ?..? | — | linear |
slice_ry | S Rot Y | ?..? | — | linear |
slice_rz | S Rot Z | ?..? | — | linear |
controls
| control | what it does |
|---|---|
| Spin | Spin (SPIN toggle): 0/1 discrete, default 1 (on). When on, continuously rotates the yaw at ~0.25 rad/sec, keeping the bulb tumbling (and the scene perpetually re-rendering). View-only, no CV. |
| Detail | Detail (DETAIL knob): fractal iteration budget, 4..30, discrete, default 20. Higher resolves more surface detail at greater cost; shared by both the render and the audio slice (shader caps the loop at 16). |
| Hue | Hue (HUE knob): palette shift, 0..1, default 0.55. Rotates the HSV tint applied to the lit surface and the sky background. Color only. |
| Power | Power (POWER knob): fractal exponent, 1..12, default 8 (the classic Mandelbulb). Morphs the overall shape and lobe count; shared by both the render and the audio slice. |
| Rot X | Rot X (ROT X knob): orbit camera pitch in radians, -pi..pi, default 0.5. Tilts the view up/down around the bulb. Camera-only. |
| Rot Y | Rot Y (ROT Y knob): orbit camera yaw in radians, -pi..pi, default 0.6. Spins the view left/right; auto-spin adds to this value when SPIN is on. Camera-only. |
| Screen | Screen (SCRN toggle): 0/1 discrete, default 1 (on). Perf gate for the preview; when off AND video_out is unpatched the raymarch is skipped entirely and a flat 'SCREEN OFF' panel is shown. View-only, no CV. |
| Slice | Slice (SLICE toggle): 0/1 discrete, default 0 (off). Off = video-only with no audio node. On = reveals the slice-plane UI (yellow select box + 2D readout + slice knobs) and stands up the oscillator so audio_out carries the bulb's cross-section waveform. |
| S Rot X | S Rot X (slice knob): slice plane pitch in radians, -pi..pi, linear, default 0. Re-orients which cross-section of the bulb is read out as audio. Slice-only; does not move the camera. |
| S Rot Y | S Rot Y (slice knob): slice plane yaw in radians, -pi..pi, linear, default 0. Re-orients the readout cross-section; also the horizontal axis of the on-card yellow select box. Slice-only. |
| S Rot Z | S Rot Z (slice knob): slice plane roll in radians, -pi..pi, linear, default 0. Spins the scanned cross-section within its own plane, reshaping the audio waveform. Slice-only. |
| Y | Y (slice knob): slice plane offset along its rotated normal, +/-1.2 fractal units, linear, default 0 (centered on the bulb). Scans the readout plane through the whole bulb; drives the audio waveform. Also set by dragging the yellow box vertically. |
| Zoom | Zoom (ZOOM knob): camera dolly, 0.3..3, log curve, default 1. Larger values map to a closer eye distance, framing the bulb tighter. Camera-only; does not change the audio slice. |
source
mandelbulb.ts on GitHub.