Skip to main content
Glama

Create GLSL material

create_glsl_material

Generate a GLSL material from pixel/vertex/geometry shader sources. Sources are auto-wired to companion DATs. Returns material path, DAT paths, and warnings for missing declarations or sampler binding issues.

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

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

The description discloses behavioral traits beyond annotations: it creates GLSL MAT and companion DATs, best-effort binds uniforms, and returns warnings for known TouchDesigner GLSL footguns. The annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=true) are consistent with creation behavior. No contradictions.

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

Conciseness4/5

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

The description is concise for the tool's complexity, front-loading the main purpose in the first sentence. Each sentence adds necessary detail: companion DATs, uniform binding, shader requirement, return value, and post-creation step. Minor verbosity could be trimmed, but overall efficient.

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 high parameter count (9), nested uniforms array, no output schema, and complexity, the description covers creation, companion files, uniform binding, shader requirements, return value (path, warnings), and post-creation assignment. It is complete for an agent to select and invoke the tool correctly.

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

Parameters5/5

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

The schema has 100% description coverage, so baseline is 3. The description adds significant meaning: naming convention for DATs (`<name>_pix`/`_vert`/`_geo`), best-effort binding logic for uniforms/samplers, and the requirement that pixel shader must declare `out vec4 fragColor`. This goes well beyond schema 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 clearly states 'Create a GLSL MAT under parent_path for custom-shaded geometry.' It specifies the resource (GLSL MAT), action (create), and context (custom-shaded geometry). The description distinguishes from sibling tools like create_glsl_shader by focusing on material creation with companion DATs and wiring.

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 provides clear context: 'for custom-shaded geometry' and explains the workflow including pixel shader requirements and uniform binding. It also notes post-creation assignment to a Geometry COMP. However, it does not explicitly state when not to use this tool or mention alternatives, though the purpose is well-defined.

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