Td Glsl Shaders logo

Td Glsl Shaders

Organization
TouchDesigner
td-glsl-shaders

GLSL shaders in TouchDesigner — pixel, compute, vertex, POP, uniforms, docked DATs. Use when writing GLSL or creating glslTOP/glslMAT/glslPOP.

Overview

PublisherTouchDesigner
RepositoryTDMCPSkills
Skill nametd-glsl-shaders
Stars
42
Forks
1
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by TouchDesigner on GitHub. Read the source before you install it.

Installation

Install the Td Glsl Shaders AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/TouchDesigner/TDMCPSkills/tree/main/skills/td-glsl-shaders
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/TouchDesigner/TDMCPSkills.git /tmp/TDMCPSkills
mkdir -p .claude/skills
cp -r /tmp/TDMCPSkills/skills/td-glsl-shaders .claude/skills/td-glsl-shaders
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Td Glsl Shaders in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Td Glsl Shaders on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Td Glsl Shaders is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

GLSL Shaders

Custom GPU shaders in TouchDesigner. Three contexts: TOP (image processing), MAT (materials), POP (particle compute). See reference.md for built-in uniforms, functions, and template shaders.

Contexts

  • glslmultiTOP (prefer over glslTOP) — image processing, procedural textures, compute. Supports >3 inputs and POP buffer reads
  • glslMAT — custom materials with vertex + pixel shaders, TD lighting system
  • glslPOP / glsladvancedPOP — per-point GPU compute on particle data (see td-pop-family skill). Compute shader API (P[idx], TDIn_P(), N[idx]) documented in td-pop-family reference.md. For glsladvancedPOP (multi-class, index buffer, extra outputs), see glsladvancedPOP.md. Custom attributes via attr sequence — buffer name is Color (capital C), auto-declared (see td-pop-family skill)

Naming Conventions

  • Uniforms uName, Samplers sName, Functions CapitalCase(), Locals camelCase, Constants UPPER_SNAKE
  • Input index defines at top: #define TEX_FEEDBACK 0

Docked DAT Pattern (glslTOP/glslmultiTOP)

Creating a glslmultiTOP auto-docks <name>_pixel, <name>_compute, <name>_info and auto-wires pixeldat to <name>_pixel.

Name the TOP at creation (glsl_<shader>) so the docks inherit the prefix (glsl_<shader>_pixel, …) and pixeldat is already correct — no rename, no repoint. (Docked refs snapshot at creation; renaming the TOP later does NOT follow them.)

  1. Create the glslmultiTOP with its final name glsl_<shader>.
  2. Delete the unused mode dock (_compute for a pixel shader).
  3. Write/sync the shader into <name>_pixel (already wired to pixeldat).
  4. Keep <name>_info for compile-error visibility.

glslPOP/glslcopyPOP: always write shaders into the auto-docked DATs (<name>_compute, <name>_ptCompute). Never create separate textDATs for POP shaders. Delete unused docked DATs (e.g. _vertCompute, _primCompute if not writing vert/prim shaders).

glslMAT: See td-mat-family skill for docked DAT setup and placement. Use #ifdef TD_VERTEX_SHADER / #ifdef TD_PIXEL_SHADER guards in combined shader DAT. See reference.md for MAT vertex/pixel functions and templates.

Uniforms

Up to 32 uniform vectors via operator parameters (vec0name, vec0valuex, etc.).

TOP/MAT: uniforms are NOT auto-declared. Setting vec0name=uTime does nothing unless the shader has uniform float uTime;. TD infers the type from the GLSL declaration.

Color uniforms → Colors page (TOP/MAT): for a uniform vec4 color, use the Colors sequence (color0name + color0rgbr/g/b + color0alpha) instead of the Vectors page — a 4-component RGBA uniform with a color-picker swatch. Same rule: type is inferred from the GLSL declaration, so declare uniform vec4 uName; or it reads zero. (Samplers live on the Samplers page, fixed arrays on Arrays.)

POP (glslPOP/glslcopyPOP): uniforms ARE auto-declared as float. Do NOT redeclare them — causes "Redeclaration" compile error. Cannot override the type to vec3 etc.; use constants or sampler inputs for multi-component data.

To use N uniforms, first set the sequence block count, then access vec0name, vec1name, etc.

glslPOP vec vs const Sequences

  • vec sequence — runtime uniforms, GPU reads value each frame. Use for any parameter that changes at runtime (expressions, custom pars, animated values)
  • const sequence — baked into shader source, triggers full recompilation on every value change. Use ONLY for truly static compile-time constants
  • Wrong choice causes hard switching — const with expression-driven values recompiles each frame and produces threshold jumps instead of smooth interpolation

Key Rules

  • Always TDOutputSwizzle() on all color outputs — wrong channel ordering without it
  • No #version statement — TD auto-injects it
  • texture() not texture2D() — old GLSL 1.20 names don't work
  • nonuniformEXT() for dynamically-indexed sampler arrays (Vulkan requirement)
  • glslMAT always TDDeform(TDPos()) — raw TDPos() breaks instancing
  • rgba32float format for data textures — 8-bit clamps to [0,1]
  • Expression-driven resolutions — never hardcode resolutionw/resolutionh
  • Prefer nodes over GLSL — use built-in operators for common operations (circleTOP for splats, noiseCHOP for motion, lookupCHOP for curves) instead of reimplementing in shaders. Reserve GLSL for operations that truly need custom GPU code (advection, pressure solving, etc.)

Feedback Pattern

constantTOP (clear) → feedbackTOP → glslmultiTOP → nullTOP. feedbackTOP top par must reference the downstream null.

  • feedbackTOP = 1 iteration per frame. Use npasses on glslmultiTOP for iterative solvers
  • Close the feedback loop before compiling shaders that depend on it (2D/3D type mismatch otherwise)

Sync to File

Sync the pixel DAT to disk — the fast way to author: edit the .glsl on disk, TD recompiles.

  • One set_dat_content(file_content, file_path, file_type='glsl') call writes the file and sets file/syncfile. The auto-docked pixel DAT already has language=glsl; a textDAT you create yourself needs language=glsl set (set_dat_content doesn't set it).
  • Path: code/glsl/<comp>/<subcomp>/<dat_name>.glsl (e.g. /project1/MyEffect/glsl_raymarch_pixel → code/glsl/MyEffect/glsl_raymarch_pixel.glsl)
  • Once synced, edit on disk — don't round-trip through the DAT.

See the td-dat-family skill for the full canonical flow.

Pitfalls

  • Uniforms not declared in shader — compiles but reads zero
  • TDPerlinNoise() in GLSL POP — not available in compute shaders, only TOP/MAT
  • Creating separate textDATs for glslTOP — rename and reuse auto-created docked DATs
  • Not checking <name>_info for compile errors — .errors() only shows "Compile failed"; read the docked infoDAT for actual line numbers and error details
  • feedbackTOP before wiring — outputs 2D texture, causes 3D compile errors downstream
  • Inline noise functions — use noiseTOP as sampler input instead
  • Delta time — me.time.step doesn't exist, use 1.0/me.time.rate or absTime.stepSeconds
  • centroid in GLSL — reserved keyword in GLSL 4.60, use ctr or similar
  • glslmultiTOP has no resolution par — use resolutionw/resolutionh + outputresolution='custom' (or 'useinput'). Setting resolution errors with 'td.ParCollection' object has no attribute 'resolution' and halts build_network mid-way

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Td Glsl Shaders AI skill do?

GLSL shaders in TouchDesigner — pixel, compute, vertex, POP, uniforms, docked DATs. Use when writing GLSL or creating glslTOP/glslMAT/glslPOP.

Why use Td Glsl Shaders on TypingMind?

Because you install it once and use it with any model. Td Glsl Shaders is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Td Glsl Shaders in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/TouchDesigner/TDMCPSkills/tree/main/skills/td-glsl-shaders. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Td Glsl Shaders?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Td Glsl Shaders?

As many as you like. As long as a model supports skills, you can use Td Glsl Shaders with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Td Glsl Shaders AI skill free?

It is published on GitHub by TouchDesigner. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇