Shader Programming
/shader-programming
Write game shaders from cross-engine fundamentals — the vertex→fragment pipeline, coordinate spaces, UV math, and common 2D/3D effects (tint, UV scroll, dissolve, outline, fresnel rim, vignette) in GLSL with HLSL equivalents.
- 许可证
- Apache-2.0
- 出品
- GameSkill 出品
所属合集
Awesome Gamedev Agent Skills
77 portable SKILL.md skills across 12 engines (Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox, Defold, Ebitengine), with a router.
我们测过
在 OpenGL 3.3 core (Mesa llvmpipe, EGL) + glslang 16.6.0 上通过 26/26 项检查(2026-10-28):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。
测试报告这个 skill 做什么
什么时候触发
Write game shaders from cross-engine fundamentals — the vertex→fragment pipeline, coordinate spaces, UV math, and common 2D/3D effects (tint, UV scroll, dissolve, outline, fresnel rim …
GameSkill 测过的版本
GameSkill 调优版:skill 文件取自提交 184b72be0288,按我们的 skill 流程加上可运行示例、测试报告、自检清单和中文指南。
协议:基于 gamedev-skills/awesome-gamedev-agent-skills(作者 gamedev-skills),协议 Apache-2.0。ZIP 保留协议文件(LICENSE, NOTICE),CHANGES.md 列出了 GameSkill 加的所有文件。

自检清单
- 清楚每段代码在顶点还是片元阶段,法线和视线方向在同一个空间并已归一化 / Knows which stage each piece runs in; normal and view direction share one space and are normalized
- 动画用真实时间 uniform 乘速度,并用 fract 回绕 UV / Animation uses a real time uniform times speed, with fract wrapping the UV
- 能用 mix / step / smoothstep 的地方不用分支,smoothstep 的两个边界从小到大 / Uses mix / step / smoothstep instead of branches where possible, with smoothstep edges in ascending order
- 溶解在 amount 为 0 时完全显示、为 1 时完全消失 / Dissolve is fully visible at amount 0 and fully gone at amount 1
- 发到 WebGL2 / three.js / PixiJS 时加 precision,并从代码里设置 uniform 默认值 / For WebGL2 / three.js / PixiJS, adds precision and sets uniform defaults from code
中文指南
这个 skill 做什么
让 AI 从跨引擎的基础写游戏 shader:顶点到片元的流程、坐标空间、UV 运算,以及常见的 2D/3D 效果(染色、UV 滚动、溶解、描边、菲涅尔边缘光、暗角、调色),用 GLSL 写并给出 HLSL 对照。
什么时候用
- 写或看懂顶点 / 片元 shader,弄清 UV 和坐标空间
- 做溶解、描边、边缘光、暗角、贴图滚动这类效果
- 把 shader 从 GLSL 改成 HLSL,或者从一个引擎搬到另一个引擎(three.js、PixiJS、Unity、Unreal、Godot)
怎么装
下载本页的 ZIP,把 shader-programming/ 整个文件夹放进 .claude/skills/(Claude Code)或 .agents/skills/(Codex、Cursor),重启 agent。
最小示例
ZIP 里的 gameskill/examples/tests/ 会直接从 SKILL.md 和 references/effects.md 取出 7 段 GLSL,在离屏 OpenGL 里渲染并检查像素;save_sheet.py 把 7 个效果并排画成一张图。需要 Python 3 加 moderngl numpy pillow,以及 Khronos 的 glslangValidator。
我们怎么测的
把 skill 里的 7 段 GLSL 原样取出:全部以 #version 330 通过 glslangValidator 16.6.0;按 skill 的说法验证 GLSL ES 3.00 拒绝 uniform 初始值、去掉后能通过;再用 Mesa llvmpipe(OpenGL 3.3 core,EGL 离屏)逐个渲染,对照算出来的像素值检查染色、UV 滚动按时间回绕、溶解在 0 时没有亮点、在 1 时全部消失、边缘光带的颜色、菲涅尔只在轮廓处变亮、描边只画在边上、暗角中心不变边缘变暗、调色恒等和 Rec.709 灰度、smoothstep 没有写反。测试中发现:默认 edge 0.05 时 float32 把 amount=1 的阈值算成 0.99999994,噪声正好为 1.0 的像素没有消失,我们加了一处小修改(见 CHANGES.md)。结果在 gameskill/test-report.json。
搭配
godot-shaders:Godot 着色语言的写法和内置变量scenario-godot-vfx:在 Godot 里做完整特效game-feel:受击闪白、溶解消失这类反馈
安装
告诉你的 AI
Install the skill from https://gameskill.dev/skills/shader-programming/install.md
GameSkill 测过的版本
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/shader-programming.zip -o /tmp/gameskill-shader-programming.zip
unzip -oq /tmp/gameskill-shader-programming.zip -d .claude/skills
rm /tmp/gameskill-shader-programming.zip包含内容
- Worked steps: Fragment basics: sample, tint, and combine; Scrolling UVs (animated texture) — frame-rate independent; Dissolve; Fresnel rim light (3D) — brighten glancing angles
- A pitfalls section with the mistakes to avoid
- Bundled 1 reference doc the agent reads when needed
适合
- Requests about shaders, fragment/pixel shader, vertex shader, UV or GLSL
试试这条提示词
Write a dissolve shader with a glowing edge in GLSL, and give me the HLSL version.关于这个 Skill
Write game shaders from cross-engine fundamentals — the vertex→fragment pipeline, coordinate spaces, UV math, and common 2D/3D effects (tint, UV scroll, dissolve, outline, fresnel rim, vignette) in GLSL with HLSL equivalents. Use when the user mentions shaders, fragment/pixel shader, vertex shader, UV, GLSL, HLSL, or effects like dissolve, outline, or rim light.
From the shader-programming SKILL.md in gamedev-skills/awesome-gamedev-agent-skills.
What's inside
- Fragment basics: sample, tint, and combine
- Scrolling UVs (animated texture) — frame-rate independent
- Dissolve (threshold a noise map, glow the edge)
- Fresnel rim light (3D) — brighten glancing angles
常见问题
2D 战斗特效与着色器套装(Godot 4 + Unity 8 合 1)
直接解决 AI 独立游戏最难手写的 8 类 2D 视觉硬资产(Godot 4 + Unity HLSL 1:1 同步交付):两段受击闪白、AI 抠图去白边杂点、全息金卡扫光、图集安全风吹、程序化剑气弧光、Boss 转阶段冲击波、余烬灼烧溶解与 5 合 1 画风滤镜。
- 8 套 Godot 4 (.gdshader) + 8 套 Unity 2D HLSL (.shader) 共 16 个实战验证着色器文件
- 含 AI 抠图去边神器(渲染期实时 smoothstep 消除半透明脏边,无需重导出原图)
基于 gamedev-skills/awesome-gamedev-agent-skills (作者 gamedev-skills,协议 Apache-2.0)。ZIP 里保留原作者的 LICENSE 和 NOTICE,ATTRIBUTION.md 和 CHANGES.md 写明来源提交和 GameSkill 加的内容。
搭配使用
作者标注的相关 Skills,或更适合相邻任务的 Skills。
Godot Shaders
Godot 4.7 shaders for 2D and 3D: vertex and fragment code, uniforms, TIME and UV animation, and screen-reading effects.
Procedural Generation
Procedural content with seeded RNG: Perlin and Simplex noise terrain, rooms-and-corridors dungeons and weighted loot tables.
Awesome Gamedev Agent Skills 中的更多 Skills
查看全部 46 个2D Platformer
Build a 2D platformer: run/jump control with coyote time, jump buffering, and variable jump height, plus tiled levels and hazards.
Behavior Trees & Utility AI
Build a behavior-tree runtime and a Utility AI system with response curves, plus hybrid agents where the behavior tree drives utility scoring.
Bevy ECS
Structure a Bevy app around ECS: plugins, components and resources, systems with Query and Commands, system ordering and Time.
Card Game
Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.
相似 skills
Universal Modder
Skills, tools and a fal MCP that let Claude Code mod PC games you own: recon, reverse engineering, generated assets, in-game testing.
Scenario Skills
Production-ready images, video, audio and 3D from any agent through the Scenario MCP, plus expert teams for Blender, Unreal and Unity.
Puretty Sprites
An MCP server for LibreSprite (a 143-tool port of aseprite-mcp) plus ComfyUI, Krita and Blender pipelines, so an agent can turn concept art into clean, grid-aligned pixel sprites animated in up to 16 directions.
Style Cards (one art style as hard limits, switch looks by switching cards)
A GameSkill original that writes a game's art style down as a card of measurable limits (canvas, colours and palette, alpha, triangles, shading, materials, textures, voxel grid), pastes it into every asset request and checks every asset against it. Ships 16 cards from pixel (including fixed PICO-8, CGA, four-greens LCD and Endesga 32 palettes) and one-bit to low-poly, voxel and toon, a no-dependency PNG checker, a Blender GLB checker and a palette locker; switch the whole look by switching the card.