shader-programming
Writing and optimizing GLSL or HLSL shaders for real-time graphics rendering in game engines.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o shader-programming.zip https://jpskill.com/download/22224.zip && unzip -o shader-programming.zip && rm shader-programming.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22224.zip -OutFile "$d\shader-programming.zip"; Expand-Archive "$d\shader-programming.zip" -DestinationPath $d -Force; ri "$d\shader-programming.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
shader-programming.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
shader-programmingフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] shader-programming
目的
このスキルは、OpenClawがゲームエンジンにおけるリアルタイムグラフィックス用のGLSLまたはHLSLシェーダーを生成、最適化、デバッグすることを可能にします。頂点シェーダー、フラグメントシェーダー、またはコンピュートシェーダーの記述、OpenGL、Vulkan、DirectXなどのAPIとの互換性の確保といったタスクに焦点を当てています。
使用する場面
ユーザーが視覚効果、パフォーマンス調整、またはゲームエンジンとの統合のためにカスタムシェーダーを要求する場合に、このスキルを使用します。具体的には以下の通りです。
- GPU負荷を軽減するためにモバイルゲーム用のシェーダーを最適化する(例:テクスチャサンプルの最小化)。
- UnityやUnrealなどのツールで、水面レンダリングやポストプロセスのような高度なエフェクトを作成する。
- ゲーム開発のイテレーション中にシェーダーコードをデバッグする。
主要な機能
- ユーザーの仕様(例:シェーダータイプ、入力、出力)に基づいて、完全なGLSL/HLSLコードスニペットを生成します。
- 命令数の削減や精度修飾子の使用など、パフォーマンス向上のためにコードを分析・変更することでシェーダーを最適化します。
- コンパイルエラーやランタイムアーティファクトなどの一般的な問題を、修正案を提示することでデバッグします。
- GLSL 330やHLSL 5.0などのシェーダーバージョンをサポートし、ハードウェア互換性のチェックを行います。
使用パターン
OpenClawでこのスキルを呼び出すには、openclaw execute shader-programming --task <task-type> --input <details> コマンドを使用します。常にシェーダー言語(例:--lang glsl)とターゲットプラットフォーム(例:--platform vulkan)を指定してください。コード生成の場合、{"type": "vertex", "inputs": ["position", "normal"], "outputs": ["gl_Position"]} のようなJSON設定を提供します。以下のパターンに従ってください。
- 明確なタスクから開始します。例:
openclaw execute shader-programming --task generate --lang hlsl --input '{"features": ["lighting"]}'。 - 最適化の場合、既存のコードをパイプで渡します。例:
echo "existing shader code" | openclaw execute shader-programming --task optimize --lang glsl。 - 認証が必要な場合(例:外部コンパイラの場合)、コマンドを実行する前に環境変数
$OPENCLAW_API_KEYを設定してください。
一般的なコマンド/API
シェーダータスクには、OpenClawに統合された以下のコマンドを使用します。
- GLSLシェーダーのコンパイル:OpenClawのサブプロセスを介して
glslangValidator -V -o output.spv input.vertを実行します。例:openclaw execute shader-programming --subprocess "glslangValidator -V -o myShader.spv myShader.vert"。 - HLSLシェーダーのコンパイル:
fxc /T vs_5_0 /E MainVS /Fo compiled.bin input.hlslを使用し、openclaw execute shader-programming --subprocess "fxc /T vs_5_0 /E MainVS /Fo output.bin input.hlsl"として呼び出します。 - APIエンドポイント:OpenClawの
/api/shader/generateにJSONペイロードをPOSTします。例:curl -H "Authorization: Bearer $OPENCLAW_API_KEY" -d '{"lang": "glsl", "type": "fragment"}' https://api.openclaw.com/api/shader/generate。 - 設定形式:入力にはJSONを使用します。例:
{"shader": {"version": "330", "precision": "highp float"}}。エラーチェックの場合、--validateのようなフラグをコマンドに含めます。例:openclaw execute shader-programming --task validate --input "shader code" --flags "--validate"。
統合に関する注意点
このスキルは、生成されたシェーダーをプロジェクトのワークフローに組み込むことで統合します。Unityの場合、GLSL/HLSLファイルを Assets/Shaders ディレクトリに保存し、マテリアルで参照します。Unrealでは、HLSLに .usf 形式を使用します。OpenClawの呼び出しは常にスクリプトでラップしてください。例:Pythonで import subprocess; subprocess.run(["openclaw", "execute", "shader-programming", "--task", "generate", "--lang", "glsl"])。クロスエンジン互換性のため、設定でプロファイル(例:モバイル用 {"profile": "gles3"})を指定します。外部ツールを使用する場合、認証されたAPI呼び出しが失敗しないように $OPENCLAW_API_KEY が設定されていることを確認してください。
エラー処理
コンパイラの出力を解析してシェーダーエラーを処理します。GLSLの場合、glslangValidator のログで「ERROR: 0:5: 'undeclared identifier'」のようなパターンをチェックし、不足している変数を追加するなどの修正案を提示します。コードでは、try { subprocess.run(["glslangValidator", "-V", "input.vert"]) } catch e { print(e.stderr); if "syntax error" in e.stderr: return "Fix line 5 with correct syntax" } のようにします。HLSLの場合、「error X3004: undeclared identifier」のような fxc エラーは変数の再宣言が必要です。OpenClawの組み込み検証を使用します。openclaw execute shader-programming --task debug --input "shader code" は、{"errors": ["Line 10: missing semicolon"]} のようなJSONを返します。常にエラーをタイムスタンプ付きでログに記録し、修正された入力で再試行してください。
具体的な使用例
-
シンプルな3Dオブジェクト用の基本的なGLSL頂点シェーダーを生成します。
openclaw execute shader-programming --task generate --lang glsl --input '{"type": "vertex", "inputs": ["vec3 position"]}'を使用します。これにより、attribute vec3 aPosition; void main() { gl_Position = vec4(aPosition, 1.0); }が生成されます。 -
既存のHLSLフラグメントシェーダーをパフォーマンスのために最適化します。
openclaw execute shader-programming --task optimize --lang hlsl --input "float4 PSMain(float2 uv : TEXCOORD) : SV_Target { return float4(uv, 0.0, 1.0); }"を実行します。出力はfloat4 PSMain(float2 uv : TEXCOORD) : SV_Target { return float4(uv.x, uv.y, 0.0, 1.0); } // Optimized by inlining.のようになる場合があります。
グラフ関係
- 関連:game-dev クラスター(例:レンダリングパイプラインの graphics-programming とノードを共有します)。
- リンク:graphics-programming(より広範なAPI統合のため)、rendering-engines(エンジン固有のシェーダーフックのため)、performance-optimization(シェーダーチューニング技術のため)。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Purpose
This skill allows OpenClaw to generate, optimize, and debug GLSL or HLSL shaders for real-time graphics in game engines. It focuses on tasks like writing vertex, fragment, or compute shaders, ensuring compatibility with APIs like OpenGL, Vulkan, or DirectX.
When to Use
Use this skill when users request custom shaders for visual effects, performance tweaks, or integration with game engines. Specifically:
- Optimizing shaders for mobile games to reduce GPU load (e.g., minimizing texture samples).
- Creating advanced effects like water rendering or post-processing in tools like Unity or Unreal.
- Debugging shader code during game development iterations.
Key Capabilities
- Generate complete GLSL/HLSL code snippets based on user specs (e.g., shader type, inputs, outputs).
- Optimize shaders by analyzing and modifying code for better performance, such as reducing instructions or using precision qualifiers.
- Debug common issues like compilation errors or runtime artifacts by suggesting fixes.
- Support shader versions like GLSL 330 or HLSL 5.0, with checks for hardware compatibility.
Usage Patterns
To invoke this skill in OpenClaw, use the command: openclaw execute shader-programming --task <task-type> --input <details>. Always specify the shader language (e.g., --lang glsl) and target platform (e.g., --platform vulkan). For code generation, provide a JSON config like: {"type": "vertex", "inputs": ["position", "normal"], "outputs": ["gl_Position"]}. Follow this pattern:
- Start with a clear task: e.g.,
openclaw execute shader-programming --task generate --lang hlsl --input '{"features": ["lighting"]}'. - For optimization, pipe existing code: e.g., echo "existing shader code" | openclaw execute shader-programming --task optimize --lang glsl.
- If authentication is needed (e.g., for external compilers), set $OPENCLAW_API_KEY in your environment before running commands.
Common Commands/API
Use these OpenClaw-integrated commands for shader tasks:
- Compile GLSL shaders: Run
glslangValidator -V -o output.spv input.vertvia OpenClaw's subprocess, e.g.,openclaw execute shader-programming --subprocess "glslangValidator -V -o myShader.spv myShader.vert". - Compile HLSL shaders: Use
fxc /T vs_5_0 /E MainVS /Fo compiled.bin input.hlsl, invoked asopenclaw execute shader-programming --subprocess "fxc /T vs_5_0 /E MainVS /Fo output.bin input.hlsl". - API endpoints: POST to OpenClaw's /api/shader/generate with JSON payload, e.g., curl -H "Authorization: Bearer $OPENCLAW_API_KEY" -d '{"lang": "glsl", "type": "fragment"}' https://api.openclaw.com/api/shader/generate.
- Config formats: Use JSON for inputs, e.g., {"shader": {"version": "330", "precision": "highp float"}}. For error checks, include flags like --validate in commands, e.g.,
openclaw execute shader-programming --task validate --input "shader code" --flags "--validate".
Integration Notes
Integrate this skill by embedding generated shaders into your project workflow. For Unity, save GLSL/HLSL files in the Assets/Shaders directory and reference them in materials. In Unreal, use the .usf format for HLSL. Always wrap OpenClaw calls in a script, e.g., in Python: import subprocess; subprocess.run(["openclaw", "execute", "shader-programming", "--task", "generate", "--lang", "glsl"]). For cross-engine compatibility, specify profiles in configs (e.g., {"profile": "gles3"} for mobile). If using external tools, ensure $OPENCLAW_API_KEY is set for authenticated API calls to avoid failures.
Error Handling
Handle shader errors by parsing compiler output. For GLSL, check glslangValidator logs for patterns like "ERROR: 0:5: 'undeclared identifier'", then suggest fixes, e.g., add missing variables. In code: try { subprocess.run(["glslangValidator", "-V", "input.vert"]) } catch e { print(e.stderr); if "syntax error" in e.stderr: return "Fix line 5 with correct syntax" }. For HLSL, fxc errors like "error X3004: undeclared identifier" require redeclaring variables. Use OpenClaw's built-in validation: openclaw execute shader-programming --task debug --input "shader code", which returns JSON like {"errors": ["Line 10: missing semicolon"]}. Always log errors with timestamps and retry with corrected inputs.
Concrete Usage Examples
-
Generate a basic GLSL vertex shader for a simple 3D object: Use
openclaw execute shader-programming --task generate --lang glsl --input '{"type": "vertex", "inputs": ["vec3 position"]}'. This produces: attribute vec3 aPosition; void main() { gl_Position = vec4(aPosition, 1.0); } -
Optimize an existing HLSL fragment shader for performance: Run
openclaw execute shader-programming --task optimize --lang hlsl --input "float4 PSMain(float2 uv : TEXCOORD) : SV_Target { return float4(uv, 0.0, 1.0); }". Output might be: float4 PSMain(float2 uv : TEXCOORD) : SV_Target { return float4(uv.x, uv.y, 0.0, 1.0); } // Optimized by inlining.
Graph Relationships
- Related to: game-dev cluster (e.g., shares nodes with graphics-programming for rendering pipelines).
- Links to: graphics-programming (for broader API integration), rendering-engines (for engine-specific shader hooks), and performance-optimization (for shader tuning techniques).