Demoscene / Shader Art / Raymarching

Worlds rendered from pure math, squeezed into kilobytes of code.

What it is

A code-native craft where the moving image is computed in real time from mathematics rather than recorded or modeled by hand. Its core technique is raymarching of signed distance fields (SDFs): a pixel shader marches a ray through a scene defined by distance functions, sculpting organic geometry, fractals, fog and light with no stored meshes or textures. Rooted in the demoscene's tradition of size-limited 'intros' (64k and 4k executables), the discipline treats procedural generation and brutal compression as expressive constraints, not obstacles.

How it is made

Two triangles and a pixel shader

The canonical setup, popularized by Inigo Quilez's 'Rendering Worlds with Two Triangles' (NVScene 2008): draw a single full-screen quad and let a fragment/pixel shader compute every pixel. The whole 'scene' lives in GPU code, which is why a complete audiovisual piece can fit in 4096 bytes including engine, music and shaders.

Raymarching signed distance fields

Instead of triangles, geometry is described by a distance function f(p) returning how far any point is from the nearest surface. Sphere tracing advances a ray by that safe distance each step until it converges on a hit. Primitives are combined with union/intersection/smooth-min operators, and space is folded and repeated to multiply detail cheaply, as codified in Mercury's hg_sdf library and Quilez's SDF articles.

Procedural everything, then crush it

Textures, meshes, animation and even music are synthesized at runtime from parameters, not stored. Farbrausch's fr-08 fit a multi-minute 3D show in ~64kB using procedural content and the V2 software synth, then packed the executable; ryg's kkrunchy packer became the scene standard for 64k intros.

Where it comes from

From cracktros to standalone intros

The demoscene grew out of 1980s software cracking: crackers prepended 'cracktros' with scrolling text, music and effects to claim credit. As the artistry outgrew the piracy, standalone 'intros' and 'demos' split off around 1988-1991, and competitive demoparties (The Party in Denmark, Assembly from 1992) replaced underground copyparties.

The 64k watershed

Farbrausch's fr-08: .the .product (1st, The Party 2000) proved procedural generation could pack a full 3D production into 64kB, opening the modern 64k era. Conspiracy's Chaos Theory (Assembly 2006) and later Approximate's Gaia Machina and Ctrl-Alt-Test's F - Felix's Workshop (both Revision 2012) pushed lighting, post-processing and CPU-generated assets to film-like polish inside the size cap.

Raymarching goes public via Shadertoy

Quilez's 2008 SDF works (e.g. Slisesix, 4k procedural graphics winner at Euskal Party 2008) and his nvscene talk turned raymarching into a teachable method. Co-founding Shadertoy with Pol Jeremias moved the craft out of the demoparty hall into a browser-based, live-coded WebGL commons where sphere tracing now underpins the majority of shaders.

Artists

  • Inigo Quilez

    Organix (2008), Fruxis (2012), Rainforest (2016), Greek Temple (2017), Selfie Girl (2020); Shadertoy co-founder

    Popularized raymarching of signed distance fields and built the public toolbox (Shadertoy + iquilezles.org) the whole field learns from; his personal gallery is a museum of single-shader procedural worlds.

  • Mercury

    epsilon (64k, 2011), the timeless (64k, 2014), Fermi Paradox (64k, Revision 2016, 1st), hg_sdf SDF library (2016)

    German demogroup whose hg_sdf library distilled SDF construction into reusable, Lipschitz-correct operators, and whose cinematic 64k intros set the bar for raymarched space and light.

  • Farbrausch

    fr-19: poemtoahorse (64k, 2002), fr-25: the.popular.demo (2003), fr-08: .the .product (64k, The Party 2000, 1st), fr-41: debris (2007)

    Defined the modern 64k intro through procedural-content tools (werkkzeug) and the kkrunchy executable packer that became the scene standard; everything is synthesized at runtime, then crushed.

  • Conspiracy

    Chaos Theory (64k, Assembly 2006), Offscreen Colonies (64k, Revision 2015, 1st), Darkness Lay Your Eyes Upon Me (64k, Revision 2016)

    Hungarian group whose high-energy 64k intros evolved into narrative, film-graded short films rendered entirely from kilobytes of procedural code.

  • Ctrl-Alt-Test

    F - Felix's Workshop (64k, Revision 2012), H - Immersion (64k, Revision 2017)

    French group that fuses CPU-generated geometry, raymarching and film-grade post-processing (bokeh DoF, motion blur, volumetric light) inside a single 64kB binary.

  • Future Crew

    Second Reality (Assembly 1993, 1st), Unreal (1992)

    Finnish group whose 1993 Second Reality fused real-time 3D, image warping and music-synced effects into the defining early PC demo.

  • Fairlight

    Agenda Circling Forth (Amiga, Breakpoint 2010, 1st), Coma (PC)

    Swedish group, born in 1987 cracking on the C64, that grew into a long-running demoscene fixture across C64, Amiga and PC.

  • Andromeda Software Development

    Lifeforce (Assembly 2007, 1st), Iconoclast (Assembly 2005, 1st), Metamorphosis

    Greek group whose OpenGL demos flow abstract effects into one continuous stream, with code and camera paths hardcoded by coder Navis.

  • The Black Lotus

    Starstruck (Amiga AGA, Assembly 2006, 1st), Ocean Machine, Captured Dreams

    Swedish group, formed in 1989 on the Amiga, whose AGA demo Starstruck pushed the aging hardware to game-like 3D scenes.

  • Shane

    Geometric Extrusion, Cellular Tiled Tunnel, Voronoi and curl-noise pattern shaders

    Prolific Shadertoy author whose heavily commented shaders on procedural patterns, Voronoi and raymarched detail are widely studied and reused.

  • nimitz (stormoid)

    Protean Clouds, Auroras, Cloud Ten, Xyptonjtroz, Re-entry

    Shadertoy author known for cinematic volumetric shaders, building nebulae, clouds and fluids from noise and raymarched distance fields.

  • kishimisu

    An Introduction to Shader Art Coding shader (mtyGWy, 2023) and its companion tutorial

    Shadertoy author and educator whose 2023 tutorial teaches shader art from a single fragment shader using palettes, tiling and the sine function.

  • Approximate

    Gaia Machina (Revision 2012, 64k intro)

    Swedish (Stockholm) demogroup whose 64k intro Gaia Machina renders lush procedural nature scenery inside 64 kilobytes.

  • Reinder Nijhoff

    Quadtree Forest, Street View, Industrial Complex, planet/biplanes raymarched Shadertoy scenes

    Dutch coder whose Shadertoy raymarchers pack whole navigable forests, cities and a Street View clone into one fragment shader using quadtree acceleration.

Frames

Inigo Quilez

  • Organix (2008) by Inigo Quilez
    Organix (2008) · Inigo Quilez · Source
  • Fruxis (2012) by Inigo Quilez
    Fruxis (2012) · Inigo Quilez · Source
  • Insect (2013) by Inigo Quilez
    Insect (2013) · Inigo Quilez · Source
  • Volcanic (2013) by Inigo Quilez
    Volcanic (2013) · Inigo Quilez · Source
  • Woods (2013) by Inigo Quilez
    Woods (2013) · Inigo Quilez · Source
  • Fractal Cave (2016) by Inigo Quilez
    Fractal Cave (2016) · Inigo Quilez · Source
  • Rainforest (2016) by Inigo Quilez
    Rainforest (2016) · Inigo Quilez · Source
  • Greek Temple (2017) by Inigo Quilez
    Greek Temple (2017) · Inigo Quilez · Source
  • Selfie Girl (2020) by Inigo Quilez
    Selfie Girl (2020) · Inigo Quilez · Source
  • Sea Creature (2022) by Inigo Quilez
    Sea Creature (2022) · Inigo Quilez · Source

Mercury

  • Fermi Paradox (2016) by Mercury
    Fermi Paradox (2016) · Mercury · Source
  • Fermi Paradox (2016) by Mercury
    Fermi Paradox (2016) · Mercury · Source
  • Fermi Paradox (2016) by Mercury
    Fermi Paradox (2016) · Mercury · Source
  • the timeless (2014) by Mercury
    the timeless (2014) · Mercury · Source
  • delight (2015) by Mercury
    delight (2015) · Mercury · Source
  • epsilon (2011) by Mercury
    epsilon (2011) · Mercury · Source
  • luma (2014) by Mercury
    luma (2014) · Mercury · Source

Farbrausch

  • fr-08: .the .product (2000) by Farbrausch
    fr-08: .the .product (2000) · Farbrausch · Source
  • fr-19: poemtoahorse (2002) by Farbrausch
    fr-19: poemtoahorse (2002) · Farbrausch · Source
  • fr-25: the.popular.demo (2003) by Farbrausch
    fr-25: the.popular.demo (2003) · Farbrausch · Source
  • fr-41: debris (2007) by Farbrausch
    fr-41: debris (2007) · Farbrausch · Source

Conspiracy

  • Chaos Theory (2006) by Conspiracy
    Chaos Theory (2006) · Conspiracy · Source
  • Chaos Theory (2006) by Conspiracy
    Chaos Theory (2006) · Conspiracy · Source
  • Offscreen Colonies (2015) by Conspiracy
    Offscreen Colonies (2015) · Conspiracy · Source
  • Offscreen Colonies (2015) by Conspiracy
    Offscreen Colonies (2015) · Conspiracy · Source
  • Darkness Lay Your Eyes Upon Me (2016) by Conspiracy
    Darkness Lay Your Eyes Upon Me (2016) · Conspiracy · Source

Ctrl-Alt-Test

  • F - Felix's Workshop (2012) by Ctrl-Alt-Test
    F - Felix's Workshop (2012) · Ctrl-Alt-Test · Source
  • F - Felix's Workshop (2012) by Ctrl-Alt-Test
    F - Felix's Workshop (2012) · Ctrl-Alt-Test · Source
  • H - Immersion (2017) by Ctrl-Alt-Test
    H - Immersion (2017) · Ctrl-Alt-Test · Source

Approximate

  • Gaia Machina (2012) by Approximate
    Gaia Machina (2012) · Approximate · Source

Techniques

  • SDF raymarching
  • sphere tracing
  • procedural noise (FBM)
  • domain repetition & folding
  • SDF CSG (min/max, smooth-union)
  • analytic & finite-difference normals
  • soft shadows & AO from distance
  • size-coding & executable compression
  • palette functions
  • effect-to-music synchronization
  • tracker & softsynth music
  • bounding-volume / quadtree raymarch acceleration
  • KIFS (Kaleidoscopic IFS) fractals
  • cone tracing for soft shadows
  • temporal reprojection / accumulation

Tools

  • GLSL / Shadertoy
  • HLSL
  • Werkkzeug
  • hg_sdf (Mercury)
  • Crinkler
  • kkrunchy
  • 4klang
  • Clinkster
  • trackers
  • Demozoo
  • Pouet
  • GNU Rocket (sync tracker)
  • Bonzomatic (live-coding)
  • Sointu / oidos (softsynths)

What to take from it

Constraint as a creative engine

A hard size or hardware budget forces invention: when nothing can be stored, everything must be generated, and the parameters become the art. Adopt an artificial limit to push toward procedural, compressible ideas instead of asset hoarding.

Geometry from distance, not vertices

Thinking of shapes as 'how far is the nearest surface' lets you blend, repeat and morph forms with arithmetic. Smooth-min unions and domain repetition give organic, infinitely detailed worlds for almost no code.

Light and grade carry the image

Soft shadows, ambient occlusion, fog, depth-of-field bokeh and color grading turn raw SDFs into atmosphere. The demoscene's leap from fr-08 to Fermi Paradox is largely a story of post-processing and pacing, not more polygons.

Further reading