Page 31: Texture Tsl Examples
Spring 2026 Sample Solution
I think the best way to learn TSL is to try it and look at examples.
I won’t try to write a tutorial about the graph editor TSL Graph, but I do recommend experimenting with it.
Some hints:
- To save your work, use the “file” menu (at the top of the interface). This will write a
.jsonfile that you can load back in. - To get the JavaScript code, look for the “<>” icon at the bottom. It shows the code in a modal and you can copy/paste it into your own program.
- Click on a node to “inspect it” - the lower-right panel allows you to see the list of inputs and outputs and change them. You can turn things on and off to determine what is shown in the interface.
- If you turn on “debug mode” (a bug icon at the bottom of the screen), the node inspector shows an image of what that node looks like applied to an object.
New TSL Ports
Converting the GLSL shaders is straightforward, so I had CoPilot/Codex convert a few of the examples from the workbook. You can look at the code (each html file has a corresponding js file) to get an idea.
A Warning About Colors
When we move from the WebGL to the WebGPU renderer, three.js switches to a different color model (color space mapping). This makes it easier to do physically correct lighting. However, it means that all of our old colors need to be adjusted. Over the next few pages, you will notice that the WebGL and WebGPU versions of the same demos have slightly different colors.
These demos use the WebGL colors - I did not adjust the colors to make things match visually.