← Home

Recreating Key Lento from GTA VI in Blender with Python

2026-12-04

After reading ben3d's breakdown of GTA VI's graphics pipeline, I wanted to build a partial recreation of Key Lento from GTA VI's Leonida Keys and step through the same eight rendering stages in Blender 5.3 and Cycles. The constraint I set for myself was simple: apart from small CC0 decorative props from Poly Haven, nothing would be modeled by hand. Every structure, bridge, shoreline, boat, tree, and light would come from Python scripts.

The interactive showcase—with the 60-second film, stage build-up cut, interactive eight-pass stepper, raw-vs-graded sliders, and all 20 1440p stills—is live at gta6.dhaiwat.com, and the full script pipeline is on GitHub.

60-second stage build-up: the same eleven camera moves assembling the geometry and layering all eight Cycles render passes.

Building the assets from Python

Generating a whole coastal environment with Claude Code agents falls apart quickly if each script invents its own coordinates, units, or material names. Before writing any geometry, I pinned down a single written contract (SCENE_SPEC.md): meters everywhere, sea level at z = 0, the highway centerline along y = 0, an analytic elevation curve road_z(x) climbing from 2.0 m on land to a 9.0 m bridge crest, shoreline polygons, lighting presets, and naming conventions for collections and lights.

From that spec, fourteen standalone generator scripts (build_terrain.py, build_highway.py, build_viaduct.py, build_shop.py, build_dock.py, build_houses.py, build_marine.py, build_palms.py, build_vegetation.py, and so on) each build a self-contained .blend library from an empty scene, render multi-angle previews, and iterate until the silhouette and surface weathering hold up. Every emissive material multiplies its strength by a shared LIGHTS_ON node and every light object lives in an LGT_* collection, so flipping between midday and dusk is a single switch during assembly.

assemble.py pulls all fourteen libraries into scene/keys_scene.blend, places boats, props, power lines, and cameras, runs the scatter passes, and audits the finished scene for floating or buried objects. The assembled file holds 2,104 objects, 69,985 mesh instances, and roughly 1.50 billion rendered triangles.

Orthographic site map of Key Lento looking north: two keys linked by a highway bridge and old viaduct, bait shop and boat basin on the bay side, seagrass flats and mangrove islets to the north, and ocean beach to the south
Orthographic overview of the assembled scene looking north: bay flats and mangrove islets at top, ocean beach below, Heron Cut channel between the two keys.

Terrain, water, and vegetation

One NumPy height function defines both limestone keys, the dredged boat basin, the 6.5 m deep main tidal channel, the bay-side seagrass flats, and the ocean sandbar spit. Generating the terrain mesh, the closed water mesh, and all land-cover shading masks from that same function keeps shorelines crack-free without manual sculpting:

Low view beneath Heron Cut Bridge showing turquoise channel water and bounce light on the concrete soffit Ocean beach with kayak, leaning coconut palm, shallow turquoise water, and bridge behind
Left: volumetric water absorption and turquoise bounce light under Heron Cut Bridge. Right: ocean beach, sandbar spit, and instanced coastal foliage.

Skies, lighting, and trade-offs

Each camera renders across three distinct setups: midday (58° sun), golden hour (7° sun over the bay), and blue-hour dusk (−5° sun with 121 emissive neon tubes, festoon bulbs, street lamps, and area fixtures switched on). By day, the sky is a Poly Haven CC0 photograph with its sun painted out so a calibrated 0.55° sun lamp casts crisp contact shadows under palm fronds that soften with distance. Golden hour and dusk use procedural gradient skies with three cirrus layers and an earth-shadow / Belt of Venus twilight band.

Heron's Bait and Tackle at dusk with neon signs and festoon bulbs glowing
Timber pier looking west into a low golden-hour sun over the bay Midday view from the old railway viaduct overlooking the bait shop, pier, and mangrove islets
Three lighting presets: blue-hour dusk with 121 practical fixtures (top), 7° golden hour over the bay (bottom left), and 58° midday sun from the old viaduct (bottom right).

A few things looked worse when simulated physically and were cut on purpose. I generated and tested volumetric OpenVDB cumulus clouds, then dropped them because they read as synthetic in wide aerial shots. Seabed caustics stayed as a procedural pattern in the sand shader rather than refractive photon paths, and selected 2K texture maps were halved during assembly to keep peak render memory comfortable on a 24 GB MacBook Pro.

Post-processing and remote GPU rendering

Every camera renders raw to a compact multilayer EXR rather than baking the grade into the render. Blender writes data passes (depth, normals, roughness) as float32 even when half-float is selected, inflating a 2560×1440 EXR to ~137 MB; a post-write compaction script rewrites those data passes to half-float and brings files down to ~68 MB. A headless compositor then applies exposure trim, energy-conserving bloom, sun flare, halation, selective cyan-teal saturation, split toning, vignette, and luminance-weighted grain in scene-linear space before AgX—taking 1.9 seconds per 1440p frame and outputting all eight cumulative render stages for the interactive breakdown and build-up film.

Raw ungraded Cycles render of Heron's Bait and Tackle at dusk Graded Cycles frame of Heron's Bait and Tackle at dusk with bloom, halation, and split tone
Raw AgX output (left) vs. the scene-linear film pass (right) on the dusk bait shop.

Local 1440p stills took 87–313 seconds per frame on an M4 Pro (Metal). At 55.5 seconds per 1080p frame, rendering the 60-second film (1,464 frames including dissolve handles, 128 samples, physical motion blur) on the laptop alone would have taken ~23 hours. Instead, I wrote a small SSH/rsync kit in scripts/remote/ to bundle dependencies, assign whole unstarted shots to two rented RTX 4090s (avoiding mixed device noise inside a shot), and verify Metal-vs-OptiX parity across three reference frames within ±1% per channel. The 4090s ran at 8–10 seconds per frame per card, finishing the main film in 1 hour 56 minutes—$5.72 in total GPU rental including the extra build-up passes and tests.

The finished 60-second cut (1,464 frames, 1080p, 24 fps, 128 samples on two rented RTX 4090s).

← Home