Capítulo 610 de 859
A class that transpiles shader code from one language into another.
Transpiler can only be used to convert GLSL into TSL right now. It is intended to support developers when they want to migrate their custom materials from the current to the new node-based material system.
import Transpiler from 'three/addons/transpiler/Transpiler.js';
Constructor
| Signature |
|---|
new Transpiler( decoder : GLSLDecoder, encoder : TSLEncoder ) |
Properties
| Property | Description |
|---|---|
.decoder : GLSLDecoder | The GLSL decoder. This component parse GLSL and produces a language-independent AST for further processing. |
.encoder : TSLEncoder | The TSL encoder. It takes the AST and emits TSL code. |
.linker : Linker | The linker. It processes the AST and resolves variable and function references, ensuring that all dependencies are properly linked. |
Methods
| Method | Description |
|---|---|
.parse( source : string ) : string | Parses the given GLSL source and returns TSL syntax. |