GUI Parameters
Expose material parameters through a GUI (Leva) and feed them into TSL expressions for instant, visual iteration.
1. Scenarios & Benefits
- Faster iteration: tweak parameters on-screen and observe results immediately.
- Demo-friendly: reviewers can interact with the material without changing code.
- Scalable: extend the same pattern to more nodes and material properties.
2. Install
3. Minimal example (R3F + TSL + Leva)
Combine time and sin into a pulse factor; control baseColor and speed via the GUI, then pass the expression as colorNode. time / sin.
4. Key steps
(1) GUI schema
(2) Build TSL expression
(3) Apply to the material
5. Run & verify
6. Performance & extension: uniforms
Update values via uniform to avoid rebuilding the node graph