Shader Examples

Every example runs in the browser on its own page: edit the shader in the box and press Run to recompile. The source below each demo is the same text the demo is running, so it can be copied straight out.

Most are written for ShaderToy and paste back into it unchanged - iTime, iResolution and iMouse are mapped onto the playground's uniforms rather than rewritten out of the snippet.

Example What it shows
3D Sphere Raymarching a signed distance field, with lighting and shadows.
Black Hole Gravitational lensing, an accretion disk and a photon ring. Drag to orbit.
Cloud Tunnel A spiralling plasma tunnel over a parallax starfield.
Digital Counter Seven-segment digits drawn entirely from distance functions.
Moving Field A windy grass field in a single pass. Drag to look around.
Numbers Display Rendering numbers without a font or a texture.
Parallex Mapping Faking surface depth by offsetting texture coordinates along the view ray.
Raymarching Cloud Volumetric cloud: density, self-shadowing and forward scattering. Drag to orbit.
Sci-fi Tunnel An animated corridor built from repeated polar geometry.
Tunnel 003 A second tunnel, with a different texturing and colour approach.

3D Sphere (3D Raymarching)

Snippet: Link