sickn33/antigravity-awesome-skills/shader-programming-glsl
Claude Code and agent skill by sickn33/antigravity-awesome-skills
- community
Checking that the SKILL.md file is still in the repository.
Expert guide for writing efficient GLSL shaders (Vertex/Fragment) for web and game engines, covering syntax, uniforms, and common effects.
Install
npx vskill@latest install sickn33/antigravity-awesome-skills/shader-programming-glslSKILL.md
Shader Programming GLSL
Overview
A comprehensive guide to writing GPU shaders using GLSL (OpenGL Shading Language). Learn syntax, uniforms, varying variables, and key mathematical concepts like swizzling and vector operations for visual effects.
When to Use This Skill
- Use when creating custom visual effects in WebGL, Three.js, or game engines.
- Use when optimizing graphics rendering performance.
- Use when implementing post-processing effects (blur, bloom, color correction).
- Use when procedurally generating textures or geometry on the GPU.
Step-by-Step Guide
1. Structure: Vertex vs. Fragment
The basic syntax below targets GLSL ES 1.00/WebGL 1. Host engines may inject matrices/attributes; raw WebGL must bind them explicitly. GLSL ES 3.00 uses in/out and a declared fragment output instead of attribute/varying/gl_FragColor. Compile the vertex and fragment shaders separately, link them into a program, and inspect compile/link logs.
Understand the pipeline:
- Vertex Shader: Transforms 3D coordinates to 2D screen space (
gl_Position). - Fragment Shader: Colors individual pixels (
gl_FragColor).
2. Uniforms and Varyings
uniform: Data constant for all vertices/fragments (passed from CPU).varying: Data interpolated from vertex to fragment shader.
3. Swizzling & Vector Math
Access vector components freely: vec4 color = vec4(1.0, 0.5, 0.0, 1.0);
color.rgb->vec3(1.0, 0.5, 0.0)color.zyx->vec3(0.0, 0.5, 1.0)(reordering)
Examples
Example 1: Simple Raymarching (SDF Sphere)
This is a Shadertoy-style fragment entry point using host-supplied iResolution; it requires a host wrapper for raw WebGL.
Best Practices
- ✅ Do: Use
mix()for linear interpolation instead of manual math. - ✅ Do: Use
step()andsmoothstep()for thresholding and soft edges (avoidifbranches). - ✅ Do: Pack data into vectors (
vec4) to minimize memory access. - ❌ Don't: Use heavy branching (
if-else) inside loops if possible; it hurts GPU parallelism. - ❌ Don't: Calculate constant values inside the shader; pre-calculate them on the CPU (uniforms).
Troubleshooting
Problem: Shader compiles but screen is black. Solution: Check the full clip-space transform and homogeneous gl_Position.w; perspective projection does not generally produce w = 1. Check if uniforms are actually being set from the host application. Verify UV coordinates are within [0, 1].
For GLSL ES fragment precision portability, see Khronos guidance. Profile branch/vector optimizations on the target GPU; these style suggestions do not guarantee a speedup.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shader-programming-glsl/SKILL.md
Popularity
- Repository stars
- 26,182
- Repository forks
- 4,463
- Repository npm downloads, 7 days
- 11,772
- 7-day trend score
- 72
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 20 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/sickn33/antigravity-awesome-skills/shader-programming-glsl)