TAU-HOME.COM
LOADING

The Golden Line: An Endless 3D Cinematic Train Ride Built with Claude Sonnet Next and WebGPU

Explore The Golden Line, an open-source browser-based cinematic train ride simulation built entirely in code using Three.js and WebGPU, generated with Claude Co

tau · November 30, 2026

#Three.js #WebGPU #ClaudeCode #OpenSource #CreativeCoding

The Golden Line: An Endless 3D Cinematic Train Ride Built with Claude Sonnet Next and WebGPU

Developer Prasenjit has released 'The Golden Line', an open-source browser-based cinematic train ride simulator created entirely using the latest 'Sonnet Next' model within Anthropic's coding assistant, Claude Code. The project renders a continuous, atmospheric journey of a steam locomotive winding through European-style countryside, lakes, forests, viaducts, and tunnels in real-time 3D graphics directly inside a web browser tab.

The Golden Line web-based cinematic train ride simulator screenshot

Image source: https://github.com/StarKnightt/golden-line

What sets this project apart is that every asset—including the train, landscape, trees, water, lighting, steam, and sound—is generated entirely through code. There are zero external 3D models, image files, or pre-recorded audio tracks involved. The complete source code is publicly available on GitHub under the MIT license and can be played directly in compatible web browsers.

A Cinematic 3D World Built with Modern Web Standards

The Golden Line is powered by Three.js and WebGPU, two cornerstone technologies for running high-performance 3D graphics directly within the browser.

  • Three.js: A widely used JavaScript library that simplifies the creation of 3D graphical content inside web browsers.
  • WebGPU: A modern, low-overhead web graphics API that replaces WebGL, allowing web applications to directly leverage desktop GPU acceleration for heavy parallel processing.

Spanning roughly 23,000 lines of JavaScript across its architecture, the simulation calculates foliage placement, particle steam, lighting passes, and reflections dynamically on the GPU. For instance, the steam puffing from the engine's chimney or the grass swaying in the fields are rendered through custom procedural algorithms and shaders rather than static texture maps.

Key Features and Immersive Camera Views

Users can interact with or passively observe the journey through multiple customizable modes:

  1. Five Distinct Cameras: Keyboard numbers instantly switch between cinematic viewpoints including a drone chase, a low-angle trackside view, a sprawling viaduct angle, an interior window seat, and a tunnel exit framing.
  2. Director Mode: Activating the ?director=1 URL parameter triggers an autonomous camera switching system that edits between scenic viewpoints like a film director without user intervention.
  3. Dynamic Time of Day: The simulation transitions smoothly from golden hour sunshine through sunset into dusk, tying lighting, sky atmosphere, and lamps into a unified keyframe track.
  4. Procedural Audio: Instead of audio samples, the web audio engine programmatically synthesizes the rhythmic chugs of the engine, rail joint clacks, whistle echoes, wind, and ambient wildlife depending on the time and location.

Running Locally and System Requirements

Because the application relies heavily on modern WebGPU capabilities, it requires a desktop environment with a dedicated GPU and a current version of Google Chrome or Microsoft Edge.

To explore or modify the code locally, developers can clone the repository and run standard package manager commands:

git clone https://github.com/StarKnightt/golden-line.git
cd golden-line
pnpm install
pnpm dev        # live development server
pnpm build      # rebuilds index.html

The Golden Line serves as a striking demonstration of how far generative AI coding assistants and modern browser rendering pipelines have evolved together, offering a fascinating codebase for web graphics enthusiasts and creative coders alike.

Sources

Impact-Site-Verification: 9b3ebd10-6c45-44cf-a014-5b8c19b7b285