GLSL Shader Tutorials

Learn shader programming from scratch. 40 interactive tutorials with live code you can edit in the Shader Sandbox.

Beginner (1–5)

Intermediate (6–13)

Advanced (14–30)

14
Domain Repetition
Infinite shapes with mod()
mod() repetition cell ID per-cell variation infinite geometry
15
Smooth Blending (SDF)
Smooth min for organic shapes
smin() function blend radius k organic blending metaball effect
16
Voronoi Noise
Cell-based patterns
Voronoi cells nearest neighbor search edge detection via d2 - d1 animated seeds
17
Glow & Bloom
Light emission and atmospheric glow
glow formula inverse distance tone mapping vignette
18
Morphing Shapes
Interpolating between SDFs
mix() between SDFs smooth blend factor phase cycling shape library
19
Texture Sampling
Using iChannel for multi-pass effects
iChannel uniforms framebuffer ping-pong feedback loops multi-pass pipeline
20
Post Processing
Vignette, chromatic aberration, film grain
chromatic aberration vignette film grain noise scanlines / CRT gamma correction
21
Domain Warping
FBM-based coordinate distortion for organic effects
domain warping FBM feedback coordinate distortion organic patterns
22
Reflections
Raymarching with reflection bounces
reflect() function multi-bounce rays reflectivity attenuation recursive marching
23
Soft Shadows
Penumbra shadows in raymarching
shadow ray casting penumbra softness factor k soft shadow formula shadow bias
24
Fog & Atmosphere
Exponential fog and volumetric atmosphere
exponential fog fog color blending height fog atmospheric depth cue
25
Mandelbrot Fractal
The classic Mandelbrot set with zoom
complex number iteration escape time algorithm fractal zoom smooth coloring
26
Julia Set
Interactive Julia set with animated parameter
Julia set vs Mandelbrot fixed complex parameter c interactive parameter escape coloring
27
Water & Waves
Procedural ocean with layered sine waves
layered sine waves height-based normal specular highlights Fresnel effect
28
Fire & Smoke
Procedural fire using noise and color ramp
scrolling noise fire color ramp vertical falloff turbulence layers
29
3D Domain Repetition
Infinite 3D grids with mod()
3D mod() repetition cell ID in 3D per-cell variation infinite scenes
30
FBM Terrain
Raymarched terrain with FBM heightmap
heightmap raymarching terrain normal from gradient height-based coloring terrain fog

Game Dev (31–40)

All tutorials run live in the browser. Open the Shader Sandbox to start writing shaders.

Open Shader Sandbox