This page summarizes frequently used parameters and defaults for core public APIs. For behavior-level edge cases (units, precedence, and internal/public boundaries), see docs/reference/semantic-clarifications.md.
Triode constructor options
Option
Type
Default
Notes
width
number
1280
Initial canvas width.
height
number
720
Initial canvas height.
canvas
HTMLCanvasElement
auto-created
Provide your own canvas for embedding.
makeGlobal
boolean
false
Installs globals like osc, render and the utility modules. Use liveGlobals(true) to opt in at runtime (legacy: true defaults this to true).
autoLoop
boolean
true
Starts internal RAF loop automatically.
detectAudio
boolean
follows makeGlobal
Initializes audio analyzer (a bins). Defaults to false in non-global mode unless explicitly set.
Runtime error dedupe/rate policy for update/afterUpdate/tick/compile contexts.
argPolicy
{ invalid?, nanFallback? }
{ invalid: "warn", nanFallback: 0 }
Argument coercion policy container (current runtime stores and exposes this policy for host tooling).
arrayHelpers
`"prototype" \
"module"`
"prototype"
Controls whether Array prototype helpers are installed globally.
numSources
number
4
Number of source slots s0..sN.
numOutputs
number
4
Number of output slots o0..oN.
forceWebGL
boolean
false
Force the WebGL 2 backend. The default selects WebGPU and falls back to WebGL 2.
onError
(error, context) => void
unset
Runtime hook for update/afterUpdate/tick failures.
liveMode
`"restart" \
"continuous"`
"continuous"
Eval behavior: reset on each eval vs reuse of the running outputs (legacy: true defaults this to "restart").
legacy
boolean
false
Compatibility mode: restores legacy constructor defaults and suppresses deprecation warnings for rotate(...).
enableStreamCapture
boolean
true
Enables vidRecorder capture setup.
extendTransforms
object/array
{}
Registers custom transforms at startup.
pb
unknown
null
Legacy/peer stream source integration input.
Playground scene options
Binding
Purpose
renderScene(tree, oN, options)
Publish a JSX producer to an output.
cameraPosition
Initial camera position as [x, y, z].
orthographic
Select orthographic projection. Use "pixels" for pixel units or "viewport" for the window aspect ratio.
controls
Enable orbit controls.
clearAlpha
Set the scene background alpha.
TriodeMaterial
Read a Hydra chain through signal or read a live output with mipmaps through mipmappedSource.
Module namespace aliases
Long-form aliases are available alongside short module names:
Canonical short
Friendly alias
Notes
tx
tex
Texture loaders/FBO/data helpers.
rnd
random
Random helpers.
nse
noiseUtil
Noise utility module alias; noise() remains the shader generator function.
Runtime scope note:
Use runtime-bound module APIs (H.mat, H.geom, H.tex, etc. or global helpers when enabled) instead of unscoped internal module imports, so helper calls resolve to the intended Hydra runtime instance.
Output render options
Option
Scope
Notes
renderTarget
compiled pass options
Route pass output into explicit target.
autoClear
output/scene/chain
1 = clear, <1 = accumulation fade.
fx
output/scene/chain
Adds post-processing passes.
Object-style render shorthand is also supported:
render({ to, target, css, fx, ... })
out({ to, target, css, fx, ... })
Mappings:
to -> render output
target -> renderTarget
Runtime hooks
Hook
Purpose
update(dt)
user animation/update function each frame interval
onFrame((dt, time) => void)
convenience helper to bind update with time
afterUpdate(dt)
post-render callback
click, mousedown, mouseup, mousemove
input event hooks routed from canvas
keydown, keyup
keyboard hooks routed from document
onError(error, { context, time })
centralized runtime error handling
liveGlobals(enable?)
toggles runtime global helper installation
Runtime control helpers
Method
Purpose
eval(code, options?)
Evaluate live code with per-call mode/reset/hush controls.
reset(options?)
Alias to resetRuntime with granular flags (scene/time/hooks/outputs/sources).
freeze(time?)
Pause time progression at current or explicit time.
step(dtMs?)
Advance a single deterministic frame step (works with frozen runtime).