Create GLSL material
create_glsl_materialCreate a GLSL material in TouchDesigner from pixel, vertex, and geometry shader sources, with automatic uniform and sampler binding. Includes checks for common GLSL issues and returns paths to the material and DATs.
Instructions
Create a GLSL MAT under parent_path for custom-shaded geometry. The pixel/vertex/(optional) geometry shader source is placed in companion Text DATs (<name>_pix/_vert/_geo) and wired to the GLSL MAT's pixel/vertex/geometry parameters; numeric uniforms are best-effort bound on the Vectors sequence and samplers on the Samplers sequence. Pixel shader must declare out vec4 fragColor;. Returns the GLSL MAT path, the DAT paths, and warnings for known TD GLSL footguns (missing fragColor, F1/F2 preamble collision, undeclared uTime, sampler bindings needing manual wiring). Artist assigns the MAT to a Geometry COMP via its material par.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name for the GLSL MAT (default 'glsl_mat1'). | |
| uniforms | No | Optional uniform declarations to best-effort bind on the GLSL MAT. | |
| two_sided | No | twoside par. | |
| parent_path | Yes | Parent COMP to create the GLSL MAT + DATs inside. | |
| glsl_version | No | GLSL Version par value. | 330 |
| pixel_shader | Yes | GLSL pixel/fragment shader source. Must declare `out vec4 fragColor;`. | |
| vertex_shader | No | Optional GLSL vertex shader source. | |
| lighting_space | No | lightingspace par. | world |
| geometry_shader | No | Optional GLSL geometry shader source. |