TSL (Three.js Shading Language) is a node-based shader composition system for Three.js. Shader logic and control flow is built up by composing special functions,
with a focus on composability, intuitive sharing of logic across modules and customizability. TypeGPU fits naturally into this system thanks to the @typegpu/three package. You can choose to write your TSL building blocks in TypeGPU, which has a few benefits:
Control-flow like if statements and for loops makes use of familiar JavaScript syntax instead of special functions.
The code you write is semantically valid JavaScript, with types flowing through each expression.
Unit-testability, since you can call these functions on the CPU
Below are a select few cases comparing TSL and TypeGPU: