shader-programming
Qué hace
Explica cómo funcionan los shaders y cómo construir efectos visuales habituales con ellos. Es para desarrolladores y artistas técnicos que quieren efectos como disolución, contornos o luz de borde.
Cuándo usarla
- ✓Cuando quieres un efecto visual como disolución, contorno o luz de borde en un sprite o modelo.
- ✓Cuando necesitas entender las UV, los espacios de coordenadas o las etapas de vértice y fragmento.
- ✓Cuando quieres traducir un shader entre GLSL y HLSL o entre motores.
Link de la skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/shader-programming/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Puedes escribir un shader que disuelva mi sprite de personaje desde los bordes y añada un contorno brillante?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente explica qué hace cada etapa y después escribe un shader de fragmento que usa coordenadas UV y un valor de ruido para desvanecer los píxeles. Añade el contorno muestreando píxeles cercanos, en GLSL con equivalentes en HLSL.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Shader programming (cross-engine)
Shaders are small programs that run per vertex and per pixel on the GPU.
The concepts — the pipeline, coordinate spaces, UVs, and how common effects are
built — port across engines; only the language dialect and built-in variable
names change. This skill teaches those portable fundamentals in GLSL with HLSL
equivalents; use godot-shaders (or Unity/Unreal material docs) for the exact
engine syntax and built-ins.
When to use
- Use to understand or write vertex/fragment shaders and to reason about UVs, coordinate spaces, and the GPU pipeline.
- Use to build common effects: tint/recolor, scrolling textures, dissolve, outlines, fresnel/rim light, vignette, color grading.
- Use to translate a shader concept between GLSL and HLSL, or between engines.
When not to use: for an engine's exact shader language and built-ins, use
godot-shaders (Godot shading language) or the engine's material docs. For full
particle VFX systems, see unreal-niagara. For post-process stacks, defer to
the engine's renderer settings.
Core workflow
- Know which stage you're in. The vertex shader transforms each vertex into clip space and passes data (UVs, normals) onward; the fragment/pixel shader runs per rasterized pixel and outputs a color. Most game effects live in the fragment stage.
- Track coordinate spaces. Positions move model → world → view → clip space; normals belong in world or view space. Mixing spaces is the most common bug.
- Drive effects with UVs and time. UVs are
0..1texture coordinates; offset, scale, or distort them, and animate with atimeuniform. - Work per pixel, branch-light. Prefer
mix,step,smoothstep, andclampoverifwhere possible; GPUs run pixels in lockstep, so a branch whose condition differs between neighbouring pixels runs both sides. A branch on a uniform (same for the whole draw) is cheap. - Pass data via uniforms (constant per draw) and varyings (interpolated vertex→fragment). Keep texture samples few; they dominate cost.
- Validate source before visual testing when the tools are already available. For
GLSL, run
glslangValidator path/to/shader.fragwith the matching stage suffix; for WGSL, runnaga path/to/shader.wgsl. Check Godot.gdshaderfiles by opening the project in Godot, which has no standalone validator for them. - Verify visually and on target hardware. Shaders that look right on desktop can break on mobile (precision, missing features). Test where it ships.
Patterns
GLSL fragment snippets for desktop #version 330 (each passes
glslangValidator with that header; close to Godot's canvas_item/spatial
shaders). For GLSL ES 3.00 — WebGL2, three.js ShaderMaterial, PixiJS filters —
add precision highp float; and set uniform defaults from code: ES rejects
uniform float edge = 0.05; with "cannot initialize this type of qualifier"
(Godot's shading language accepts it). See references/effects.md for the HLSL
equivalents and the full outline/fresnel/vignette shaders.
1. Fragment basics: sample, tint, and combine
// Per-pixel: read the texture at this UV, multiply by a color (tint), keep alpha.
uniform sampler2D tex;
uniform vec4 tint; // e.g. (1,0,0,1) reddens; multiply is non-destructive
in vec2 uv; // interpolated 0..1 texture coordinate (a "varying")
out vec4 frag;
void main() {
vec4 c = texture(tex, uv); // HLSL: tex.Sample(samp, uv)
frag = c * tint; // component-wise multiply tints without clipping
}
2. Scrolling UVs (animated texture) — frame-rate independent
// Add time * speed to the UV to scroll. fract() wraps it into 0..1 so it tiles.
uniform sampler2D tex;
uniform float time; // seconds, supplied by the engine
uniform vec2 scroll_speed; // UV units per second, e.g. (0.1, 0.0)
in vec2 uv;
out vec4 frag;
void main() {
vec2 scrolled = fract(uv + scroll_speed * time); // HLSL: frac(...)
frag = texture(tex, scrolled);
}
// Drive with a real time uniform, not a per-frame accumulator, so speed is stable.
3. Dissolve (threshold a noise map, glow the edge)
// Hide pixels where noise < threshold; tint a thin band at the boundary.
uniform sampler2D tex;
uniform sampler2D noise_tex; // grayscale noise, 0..1
uniform float amount; // 0 = fully visible, 1 = fully dissolved
uniform float edg
Preguntas frecuentes
¿Cuál es la diferencia entre shader de vértice y de fragmento?
La etapa de vértice coloca cada vértice en pantalla, mientras que la de fragmento define el color de cada píxel.
¿Cubre la sintaxis de shaders de Godot?
La skill remite a la skill de shaders de Godot para la sintaxis exacta y los nombres integrados.
¿Cubre efectos de partículas?
Los sistemas de partículas completos quedan fuera de esta skill y pertenecen a la guía de Niagara de Unreal.
Detalles
Descripción original del autor
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.
Popularidad
- Estrellas en GitHub
- 6,6 mil
- Posición en el ranking
- #13805
- Licencia
- Apache-2.0
- Actualizada
- 28/10/2026
Comentarios
- …
Más skills de este repositorio
router
6,6 milAyuda a tu agente a elegir la skill de desarrollo de juegos adecuada para cada petición, detectando tu motor y el tipo de tarea que necesitas.
ai-behavior-trees-utility-ai
6,6 milAyuda a tu agente a construir un árbol de comportamiento y un sistema de IA por utilidad para enemigos y personajes que eligen acciones según prioridad y puntuación.
audio-design
6,6 milEnseña a tu agente la mezcla de audio de juegos: buses, volumen en decibelios, ducking bajo los diálogos, música adaptativa y variación de efectos de sonido.
camera-systems
6,6 milAyuda a tu agente a crear cámaras de juego que siguen con suavidad, se mantienen dentro del nivel y orbitan o miran alrededor en 3D.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.