
Shader Fundamentals
This is your reference card for GLSL shader programming. It covers the vertex to fragment pipeline, data types with swizzling, the three variable qualifiers (uniforms from CPU, attributes per vertex, varyings interpolated between shaders), and the coordinate space transforms you'll chain together. The built-in functions section is practical, the UV patterns are copy-paste ready, and the debugging techniques (like visualizing normals as RGB) actually work. If you're writing custom materials in Three.js or debugging why your shader is black, this has the syntax and patterns you need without the theory lecture. Precision qualifiers, matrix transforms, and common gotchas are all here.
- skills.sh installs
- 171
- GitHub stars
- 9
- last updated
- Aug 21, 2026
Install
$ npx -y skills add bbeierle12/skill-mcp-claude --skill shader-fundamentals --agent claude-codeInstalls into .claude/skills of the current project.
Files
Shader Fundamentals
GLSL (OpenGL Shading Language) runs on the GPU. Vertex shaders transform geometry; fragment shaders color pixels.
Quick Start
// Vertex Shader
uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
attribute vec3 position;
attribute vec2 uv;
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
// Fragment Shader
uniform float uTime;
varying vec2 vUv;
void main() {
vec3 color = vec3(vUv, sin(uTime) * 0.5 + 0.5);
gl_FragColor = vec4(color, 1.0);
}
Graphics Pipeline
Vertex Data → [Vertex Shader] → Primitives → Rasterization → [Fragment Shader] → Pixels
↑ ↑ ↑
attributes transforms per-pixel color
| Stage | Runs Per | Purpose |
|---|---|---|
| Vertex Shader | Vertex | Transform positions, pass data to fragment |
| Fragment Shader | Pixel | Calculate final color |
Data Types
Scalars
bool b = true;
int i = 42;
float f = 3.14;
Vectors
Sponsors
Details
- Repository
- github.com/bbeierle12/skill-mcp-claude
- Categories
- DevOps & CI/CD, Documentation, AI & Agent Building, Debugging, Automation & Workflows, Sales & Marketing, Game Development
- First seen
- Jun 3, 2026