triode

Core Materials

Triode materials connect Hydra signals and output textures to Three.js meshes. The JSX bindings are available inside a Playground scene.

TriodeMaterial

Attach <TriodeMaterial> inside a mesh.

PropBehavior
signalHydra chain sampled at the mesh's UV coordinates. Supply a signal when no mipmappedSource is set.
lightingSet to "phong" to react to scene lights. The default is unlit.
mipmappedSourceA Triode output to sample with mipmaps. This input takes precedence over signal.

The Playground updates the material before drawing, so live signal inputs and output textures keep updating. Run the scene cue to change the material props or lighting mode. The scene owns the material and its optional mipmap buffer. The source output keeps ownership of its texture.

Paste this cue into the Playground and run the full buffer. Change the oscillator frequency and rerun the scene cue to change the stripe spacing.

renderScene(
  <mesh>
    <boxGeometry />
    <TriodeMaterial signal={osc(8, 0.1, 0.8)} />
  </mesh>,
  o0,
  { cameraPosition: [2, 2, 3], controls: true },
);

render(o0);

Textured Box adds a rotating mesh and live material inputs. Scene Texture Bridge samples an output with mipmappedSource. The material factory compiles the signal, and the scene host binds it to the cue.

DisplacedMaterial

Attach <DisplacedMaterial> inside a mesh with position, normal, and UV attributes. The material moves each vertex along its normal by the height texture's red channel times amount.

PropBehavior
sourceRequired height input. Pass a Triode output or texture.
amountRequired displacement multiplier. Pass a number or TSL node such as a uniform.
colorSourceOptional paint input. Pass a Triode output or texture. color is an alias.
wireframeDraw edges when true. Defaults to false.
flatShadingLight each face separately when true. Defaults to false.

Height and paint follow the source filtering. Render-target UVs flip vertically. Live texture updates and uniform changes take effect during drawing. Run the scene cue to change the source bindings, flags, or geometry. In Terrain Displacement, run the Height cue alone to reshape the live mesh while its paint stays in place. See HeightShadows for shadow updates.

Source docs/api/materials.md