Semantic Clarifications
This page documents behavior that is easy to misread when jumping between Hydra-style signal chains and Three.js scene APIs.
Rotation units
rotate(angle, speed)in a signal chain uses degrees forangle(legacy behavior).rotateDeg(angle, speed)is an explicit degrees version (same behavior asrotate).rotateRad(angle, speed)is an explicit radians version (no degree conversion).rotateandrotateDegconvertangleto radians internally before applying rotation.speedis added as a time term in shader space (ang + speed * time) and is treated as radians-per-time-unit.- Three.js object rotations (for example
mesh.rotation.x += ...) use radians. - Calling
rotate(...)emits a one-time compatibility warning that points torotateDeg(...)/rotateRad(...).
Rule of thumb: use rotateDeg(...) for degree-based sketches, rotateRad(...) when matching Three.js radians, and reserve rotate(...) for legacy compatibility.
Texture and material signals
.tex(output?, options?)
- Ensures the current chain is compiled to an output. - Returns a THREE.Texture rendered from that output. - Use when you need a texture value to pass into materials, samplers, or additional texture utilities. - .texture(...) is an alias of .tex(...).
Use <TriodeMaterial signal={src(o1)} /> to sample an output live on a JSX mesh.
autoClear levels and precedence
autoClear can be configured at multiple levels:
- output level:
o0.autoClear(...) - pass/source level:
osc(...).clear(...)
Behavior:
- output-level
autoClearruns before pass execution for that output. - pass-level
autoClearapplies on each compiled pass. amount >= 1performs full clear.0 < amount < 1inserts fade accumulation behavior.- If both output and pass
autoClearare set, both effects are applied in sequence.
Render-target routing in .render(...)
render(...)/out(...) support both signatures:
- positional:
.render(output, options) - object:
.render({ to, target, ... })
Mappings:
to-> outputtarget->renderTarget
When renderTarget (or target in object form) is passed, the runtime assigns it to the terminal pass for the compiled chain:
- no FX chain: render target is applied to the material pass.
- with FX chain: render target is moved to the final FX pass.
This preserves intermediate pass wiring while guaranteeing the final output target receives the result.
Global vs non-global runtime semantics
makeGlobal: trueinstalls helpers likeosc, module namespaces, and math helpers into global scope for live-coding ergonomics.makeGlobal: falsekeeps APIs undertriode.synthfor host-safe embedding and multi-instance control.- Current constructor default is
makeGlobal: false; opt into globals explicitly with constructor config ortriode.synth.liveGlobals(true). legacy: truerestores compatibility constructor defaults (makeGlobal: true,liveMode: "restart") and suppresses compatibility warnings.
Prefer non-global mode for application integration, editor embedding, and test harnesses.