Three.js Shader Examples

Shaders are small GPU programs that decide where vertices go and what colour each pixel is. These demos use custom GLSL in three.js, written with ShaderMaterial or by extending built-in materials, to create effects that standard materials cannot produce.

The collection covers natural phenomena such as ocean waves, water caustics and volumetric fire, material effects such as subsurface scattering, fur and liquid metal, and stylised looks such as toon shading, holograms, energy shields, digital rain and portals. Each page walks through the shader maths, and the code can be adapted for your own projects.

Most viewed in advanced shaders

All advanced shaders demos

12 Demos
Three.js Water Caustics Shader (Refraction Jacobian) preview
Explore Demo →

Three.js Water Caustics Shader (Refraction Jacobian)

Physically motivated pool caustics in Three.js, where sunlight refracted through an animated water surface is focused into bright filaments on the floor, walls and objects, with optional chromatic dispersion.

shaders
Three.js Subsurface Scattering (Translucent Materials) preview
Explore Demo →

Three.js Subsurface Scattering (Translucent Materials)

Real-time translucency in Three.js using a back-face depth pre-pass for screen-space thickness, so thin parts like fingers and knot loops glow when back-lit, with jade, skin, wax and marble presets.

shaders
Three.js Toon & Cel Shading (Outlines, Rim Light, Hatching) preview
Explore Demo →

Three.js Toon & Cel Shading (Outlines, Rim Light, Hatching)

Non-photorealistic rendering in Three.js comparing MeshToonMaterial gradient maps, a custom cel shader with rim light and hard specular, and screen-space cross-hatching, all with inverted-hull outlines.

shaders
Three.js Fur Shader (Shell Texturing) preview
Explore Demo →

Three.js Fur Shader (Shell Texturing)

Real-time fur in Three.js using shell texturing, where one instanced draw renders dozens of offset shells and each strand tapers, droops with gravity, sways in the wind and can be brushed with the pointer.

shaders
Three.js Ocean Water Shader (Gerstner Waves) preview
Explore Demo →

Three.js Ocean Water Shader (Gerstner Waves)

Open ocean in Three.js with summed Gerstner waves computed on the GPU, analytic normals, Fresnel sky reflection, sun glints, crest foam and fake subsurface light, plus a buoy that rides the same waves.

shaders
Three.js Volumetric Fire Shader preview
Explore Demo →

Three.js Volumetric Fire Shader

Ray-marched volumetric campfire in Three.js where domain-warped rising fBm defines the flame, temperature drives a blackbody color ramp, and sparks plus a flickering point light complete the scene.

shaders
Three.js Hologram Shader Effect preview
Explore Demo →

Three.js Hologram Shader Effect

Sci-fi hologram shader in Three.js combining a Fresnel rim glow, scanlines, a sweeping scan band, flicker and vertex-slice glitches, displayed above a projector with a light cone.

shaders
Three.js Matrix Digital Rain Shader preview
Explore Demo →

Three.js Matrix Digital Rain Shader

Digital rain in Three.js with columns of mirrored katakana and digits from a canvas glyph atlas, each falling at its own speed with a bright leading glyph and fading trail, wrapped around the viewer.

shaders
Three.js Energy Shield / Force Field Shader preview
Explore Demo →

Three.js Energy Shield / Force Field Shader

Sci-fi force field in Three.js with a hexagonal grid, Fresnel glow, impact ripples that travel over the sphere, and a soft glow where the shield intersects the ground and ship, using a scene depth pre-pass.

shaders
Three.js Portal Effect (Render-to-Texture Window) preview
Explore Demo →

Three.js Portal Effect (Render-to-Texture Window)

A portal into another world in Three.js, where a second scene is rendered from the same camera into a render target and shown through a swirling, glowing disc with correct parallax and spiralling particles.

shaders
Three.js Liquid Metal Shader (Ray-Traced Metaballs) preview
Explore Demo →

Three.js Liquid Metal Shader (Ray-Traced Metaballs)

T-1000-style liquid metal in Three.js, with smooth-union metaballs merging into a molten pool, ray-traced with Fresnel-Schlick reflections, two bounces and a studio environment, in mercury, gold, copper or chrome.

shaders
Three.js Procedural Animated Textures Gallery preview
Explore Demo →

Three.js Procedural Animated Textures Gallery

Six fully procedural animated materials in Three.js (Voronoi cells, lava flow, marble, wood, plasma and electric arcs) evaluated per pixel in object space, with no image textures.

shaders