Skip to main content
Glama

Create GLSL material

create_glsl_material

Creates a GLSL material in TouchDesigner for custom-shaded geometry. Wires shader sources to Text DATs, binds uniforms, and returns warnings.

Instructions

Create a GLSL MAT under parent_path for custom-shaded geometry. Caller shader source requires TDMCP_RAW_PYTHON=on and TDMCP_BRIDGE_ALLOW_EXEC=1. 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?

Beyond the annotations (readOnlyHint=false, openWorldHint=true, destructiveHint=false), the description discloses key behaviors: creation of companion DATs, best-effort uniform binding, manual samplers wiring, and known GLSL footguns. This is rich, honest context that helps the agent predict side effects and limitations.

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 but every sentence is informative: purpose, prerequisites, wiring behavior, return values, and warnings. It is front-loaded with the core action and uses efficient wording without fluff, appropriate for a complex tool.

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?

With no output schema, the description fully covers return values (MAT path, DAT paths, warnings). It also explains the overall pipeline from creation to artist assignment, including known failure modes. Given the 9 parameters and complexity, nothing essential is missing.

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?

The schema already covers all parameters with descriptions (100% coverage), so baseline is 3. The description adds meaningful semantics by explaining how shader sources become companion DATs, how uniforms map to Vectors/Samplers pages, and the 'best-effort' nature of binding—value beyond the raw schema.

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 clearly states the tool creates a GLSL MAT under a parent path, with specific details about companion Text DATs and wiring. It distinguishes this from sibling tools like create_glsl_shader by targeting the GLSL MAT resource and its custom-shaded geometry workflow.

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 explicit prerequisites (TDMCP_RAW_PYTHON=on and TDMCP_BRIDGE_ALLOW_EXEC=1) and a clear use case ('for custom-shaded geometry'). It does not explicitly mention alternatives or when not to use it, but the context is strong enough to guide selection.

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/Pantani/tdmcp'

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