Skip to main content
Glama

Create GLSL material

create_glsl_material

Create 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

TableJSON Schema
NameRequiredDescriptionDefault
nameNoName for the GLSL MAT (default 'glsl_mat1').
uniformsNoOptional uniform declarations to best-effort bind on the GLSL MAT.
two_sidedNotwoside par.
parent_pathYesParent COMP to create the GLSL MAT + DATs inside.
glsl_versionNoGLSL Version par value.330
pixel_shaderYesGLSL pixel/fragment shader source. Must declare `out vec4 fragColor;`.
vertex_shaderNoOptional GLSL vertex shader source.
lighting_spaceNolightingspace par.world
geometry_shaderNoOptional GLSL geometry shader source.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes well beyond annotations by disclosing side effects: shader sources placed in companion Text DATs with specific naming conventions, wiring to GLSL MAT parameters, best-effort uniform binding, and known TouchDesigner GLSL footguns. It also states the return value (MAT paths, DAT paths, warnings) and that the artist must assign the MAT to a Geometry COMP. This is rich behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense yet well-structured, starting with the core action and then covering side effects, requirements, return values, and footguns. Every sentence adds necessary information; there is no filler or repetition of obvious schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (9 parameters, no output schema, multiple shader stages, uniform binding, and known pitfalls), the description is exceptionally complete. It covers what is created, how it is wired, what the return value contains, what prerequisites exist (fragColor declaration), and what the caller must do afterward (assign the MAT). This leaves little ambiguity for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the input schema already documents every parameter (100% coverage), the description adds meaningful cross-parameter semantics: how shader sources map to DAT names (`<name>_pix`/`_vert`/`_geo`), how the uniforms array maps numeric types to the Vectors page and sampler types to the Samplers page, and the requirement that pixel shader declares `out vec4 fragColor;`. This elevates the parameter understanding beyond individual field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Create a GLSL MAT under parent_path for custom-shaded geometry,' which is a specific verb+resource+scope. It clearly differentiates from sibling tools like create_glsl_shader by framing the output as a material (MAT) with companion Text DATs wired to it, not just a shader object.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context on when to use the tool: when you need a GLSL material for custom-shaded geometry, with shader sources and uniforms. It does not explicitly name alternatives or exclusion conditions (e.g., 'if you only need a shader, use create_glsl_shader'), so it falls short of a 5, but the usage context is unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lucasmaher-hash/touch-designer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server