Learn shaders with glint
glint · Examples · Tutorials · Gallery
Interactive courses: each step changes a running shader, and ticks itself when you've done the task.
glint is a free live shader editor in the browser: the code floats over the running picture and recompiles as you type. No account, nothing to install.
- Basics (10 steps): From a single colour to audio-reactive visuals: coordinates, shapes, time, repetition, palettes, parameters.
- Medium (10 steps): 2D design with distance fields: shapes and booleans, smooth blends, transforms, noise, kaleidoscopes, feedback, passes.
- Advanced (10 steps): 3D and beyond: raymarching, lighting, shadows, cameras, fractals, vertex shaders, GPU simulation and HLSL.
- Maths for shaders (40 steps): From first principles, each idea drawn on screen: pixels and coordinates, vectors, length, dot and cross products, projection, reflection, matrices built up gently (rules that move points, where the axes go, by hand, working backwards), rotation in 2D and 3D, perspective, a camera, and the shaping functions.
- Raymarching, step by step (20 steps): How a raymarcher works, one piece at a time: rays, distance functions, marching, normals, lighting, shadows, camera, repetition, fog; then boxes and tori, smooth blends, transforms, materials, ambient occlusion, reflections, bending space, speed and anti-aliasing.
- Matrices, from scratch (26 steps): For when matrices haven't clicked, or you never did them at school: rules that move points, what a matrix really is (where the axes go), working them out by hand, writing one from a description, columns and rows, the determinant, rotation worked out, multiplying and order, why shaders work backwards, moving with an extra 1, then 3D: the x-y-z pattern, the p.xz *= rot(a) shorthand, turning space in a raymarcher, world vs own axes, gimbal lock, any axis, look-at, blending rotations, and mat4 with perspective.
- Sound you can see (10 steps): Audio-reactive visuals: bass, mid and treble, the spectrum and waveform, beats, your own envelopes, motion that follows the music, tempo and bars, cutting on the beat, and an audio tunnel.
- Noise from scratch (10 steps): Where randomness comes from: hashes, value and gradient noise, fractal noise, ridges, domain warping, Voronoi cells, marble and wood, and a landscape map.
- Colour and light (10 steps): Making colour look good: mixing, cosine palettes, HSV, gamma, tone mapping, glows, grading, blend modes, dithering and the finishing touches.
- Passes and feedback (8 steps): Shaders that read pictures: a second pass, blurs (and why two passes beat one), bloom, feedback trails and tunnels, the Game of Life and reaction-diffusion.
- Skies and reflections (7 steps): Cube maps and HDR skies: a sky all around, a mirror ball, Fresnel, rough reflections from mipmaps, light from the whole sky, tone mapping, and your own .hdr photo (Poly Haven) as the sky and its reflections.
- Vertex shaders, step by step (21 steps): The other half of a pass: triangles from gl_VertexID, clip space, draw modes, handing values to the fragment shader (smooth and flat), instancing and random copies, additive glow, 3D meshes and the camera's matrices, depth, lighting, displacement, meshes built in code, then triangles with a glow pass and neon wireframes.
- Raymarching 2: glow, fog and light (11 steps): After Raymarching, step by step: glow from near misses (per object, on the beat), fog that hugs the ground, light shafts marched through fog and done in 2D, things that light up, bloom with a threshold, tone mapping, and what glow costs.
- Raymarching 3: worlds (20 steps): Whole places: terrain from a height, sky light, rock, grass and snow, haze towards the sun, water you see into and that reflects, less detail far away, clouds, glass, soap bubbles, light through thin parts, triplanar textures, rough rock, a different copy in every cell, limited repetition, a cave by lantern light, the Mandelbulb, a camera on a path and depth of field.
- Raymarching 4: modelling, materials and motion (20 steps): The craft: mirror symmetry, polar repetition, extrusion and revolution, shells, elongation, morphing, easing, squash and stretch, colours that melt with the shapes, three-point lighting, highlights, metal and roughness, toon shading and ink outlines, bounding volumes, smooth edges and motion blur over frames.
- Fractals, step by step (20 steps): Self-similarity, the Mandelbrot set (smooth colour, zooming, distance, orbit traps), Julia sets, the Burning Ship, Newton's fractal, Koch by folding, Apollonian circles by inversion, then 3D: Sierpinski, the Menger sponge, the Mandelbox, KIFS, quaternion Julia sets, the chaos game's fern, and an endless zoom.
- Vertex shaders 2: lines, particles and moving meshes (20 steps): After Vertex shaders, step by step: thick lines from triangles, an oscilloscope and spectrum bars from the audio, points that shrink with distance, billboards, a fountain and fireworks, instanced cubes turning and dancing to music, morphing, twisting and fixing normals, heights from another pass, a comet's tail, text from the font texture, shattering a mesh, and light per corner or per pixel.
- Fractals 2: further in (20 steps): After Fractals, step by step: other powers, skipping the inside, stripe colouring, lighting the set, the inside's cycles, the Phoenix and Lyapunov fractals, the bifurcation diagram, the chaos game on any polygon, the dragon, fractal flames, the Buddhabrot, a photocopier fractal, trees by folding, biomorphs, spheres inside spheres, hybrids, glowing fractals and fractals that listen.
- Vertex shaders 3: living geometry (20 steps): After Vertex shaders 2: a flag, ocean waves, grass and gusts, a snake, bones, pushing with the mouse, point clouds that change shape, a photo in 3D, voxels, the superformula, Unknown Pleasures from the music, shadows and reflections on the floor, a kaleidoscope of meshes, a tunnel, ribbons that face you, a forest and fur.
- Post-processing (20 steps): Effects on the finished picture: vignette, chromatic aberration, grain, lens distortion, an old TV, pixel art, dithering, halftone, ASCII art, edges, cartoon, a painterly filter, lift/gamma/gain, teal and orange, sharpening, glitch, VHS, night vision and a kaleidoscope.
- Surfaces: from vertex to fragment (21 steps): A 3D point for every pixel of a mesh, handed over by the vertex shader: noise on surfaces, per pixel not per corner, object vs world space, a 3D noise texture, marble, wood, bumps, the same noise in both shaders, normals from derivatives, a planet with air, snow from above, terrain fog and contours, triplanar textures, dissolving, flowing lava.
- Blur and glow (14 steps): Blurs that stay smooth however big they get: why spaced reads and flat weights go blocky, the Gaussian, reaching 3σ, two pixels a read, blurring smaller pictures, reading them back smoothly, bloom in several sizes, mipmaps read round a circle, then zoom (radial) blur, jitter, light shafts, spin blur and bokeh.