Import
Transpiler is an addon, and must be imported explicitly, see Installation#Addons.
import Transpiler from 'three/addons/transpiler/Transpiler.js';
Constructor
new Transpiler( decoder : GLSLDecoder, encoder : TSLEncoder )
Constructs a new transpiler.
| decoder |
The GLSL decoder. |
| encoder |
The TSL encoder. |
Properties
.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
.parse( source : string ) : string
Parses the given GLSL source and returns TSL syntax.
| source |
The GLSL source. |
- Returns: The TSL code.