Tunnel

Version 8 of 8

Raymarched tube.

GPU · SDF · 2017

This version

A real tube with ribs along a winding path, sphere-traced, lit by a light that flies ahead of you, sinking into fog.

How this version works

Rendered at a 0.7 resolution scale, this shader moves a camera along a sinusoidal three-dimensional path and aims it towards a point two depth units ahead. Each pixel traces a ray through a distance-field tube with a slightly rippled wall and annular ribs repeating every two depth units. Marching stops after at most 90 steps, near a surface, or beyond a distance of 40. Finite-difference normals support attenuated diffuse lighting and a specular highlight from a light travelling ahead of the camera. Alternating red and purple depth bands fade into dark exponential fog, followed by a final colour power adjustment.

The trick in this version

The shader generates walls and ribs mathematically rather than loading a mesh or texture. Distance estimates are multiplied by 0.8 to shorten marching steps, while the reduced render scale limits the cost of repeated field evaluations and normal sampling.

Historical context · GPU

  1. 2017 · Wsmind / TMP · Thought Process

    A raymarched 4K tunnel

    Combined 4K winner at Very Important Party 2017: the screen-to-texture table replaced by geometry evaluated in a shader.

  2. today · Iñigo Quilez · tunnel article

    Fixing the seam

    On a GPU the atan seam breaks mipmapping derivatives; the article explains the fix, a problem nearest-neighbour DOS tunnels never had.

Platform
GPU · SDF
Era
GPU
Rendered on
GPU
Tags
raymarching · point light
Sources
A raymarched 4K tunnel (2017)Fixing the seam (today)