Td Glsl Shadersのロゴ

Td Glsl Shaders

組織
TouchDesigner
td-glsl-shaders

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

概要

公開者TouchDesigner
リポジトリTDMCPSkills
スキル名td-glsl-shaders
スター
42
フォーク
1
同梱ファイル
2
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    TouchDesignerがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Td Glsl Shaders」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/TouchDesigner/TDMCPSkills/tree/main/skills/td-glsl-shaders
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでTd Glsl Shadersを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にTd Glsl Shadersを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Td Glsl Shadersは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Td Glsl Shaders」では何ができますか?

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

TypingMindでTd Glsl Shadersを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Td Glsl Shadersはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにTd Glsl Shadersをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/TouchDesigner/TDMCPSkills/tree/main/skills/td-glsl-shadersを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Td Glsl Shadersを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Td Glsl Shadersで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもTd Glsl Shadersを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Td Glsl Shaders」は無料ですか?

TouchDesignerがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇