skills/game-dev/shader-programming/SKILL.md
Writing and optimizing GLSL or HLSL shaders for real-time graphics rendering in game engines.
npx skillsauth add alphaonedev/openclaw-graph shader-programmingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Use this skill when users request custom shaders for visual effects, performance tweaks, or integration with game engines. Specifically:
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:
openclaw execute shader-programming --task generate --lang hlsl --input '{"features": ["lighting"]}'.Use these OpenClaw-integrated commands for shader tasks:
glslangValidator -V -o output.spv input.vert via OpenClaw's subprocess, e.g., openclaw execute shader-programming --subprocess "glslangValidator -V -o myShader.spv myShader.vert".fxc /T vs_5_0 /E MainVS /Fo compiled.bin input.hlsl, invoked as openclaw execute shader-programming --subprocess "fxc /T vs_5_0 /E MainVS /Fo output.bin input.hlsl".openclaw execute shader-programming --task validate --input "shader code" --flags "--validate".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.
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.
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.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui