Twinz notebook · Article 3
Showing Paris in 3D in a browser under 496 MB, with no fake passers-by
Twinz (twinzcities.com) lets you wander freely through the digital twin of Île-de-France (paris.twinzcities.com) from a simple web page. The constraint is twofold: every person you pass in the street is a real inhabitant, simulated continuously, and the browser must stay smooth under a strict ceiling of 496 MiB of video memory.
One world for the computation and for the screen
In a classic video game, the displayed map is scenery, and pedestrians appear within a fifty-metre radius of the player before vanishing behind their back. Twinz forbids that shortcut. The simulation and the 3D rendering (WebGL, the browsers' graphics interface) read exactly the same description of the city: same streets, same pavements, same junctions, same doors. No background passer-by is added, with the sole, temporary exception of parked cars until all household vehicles are simulated.
Displaying a region of 2,661,376 buildings, 49,058 tiles of 500 m and 46,072.5 km of roads in a browser tab means counting every megabyte. Nearby geometry is built on the client side with WebAssembly (compiled code that runs fast in the browser), kept in a local cache, and shadows adapt to travel speed, altitude and night. These settings brought the peak video memory (VRAM) measured in Chrome down from 525.76 to 486.88 MiB, under the target ceiling of 496 MiB.
But an average figure is never enough. Walking through Paris at eye level, three very concrete defects jumped out on 25 November: empty streets under the camera, gutted façades on slopes, and a bridge plunging into the Seine.
Priority to nearby tiles: how monuments were smothering the street
Moving along the Seine from quai Saint-Bernard towards quai de la Tournelle and Notre-Dame at 25 m/s, an absurd behaviour appeared: the buildings in the distance were there, but the ground right under the camera stayed grey and smooth, with no roadway, pavement or pedestrian crossing. The console showed no error.
The memory probe revealed the cause. At this spot, very rich in heritage, 138 detailed monument models alone were reserving 160 MiB of video memory. Out of the 496 MiB accounting ceiling, only 16.27 MiB were left to load the detailed geometry of the tile less than 20 m in front of the camera (which needed a measured 18.25 MiB). The manager was therefore refusing the street the visitor was standing in, to keep more distant monuments in memory.
The fix reversed the order of priorities. Tiles within 300 m of the camera now come before everything else, in every direction. Monuments and rich shopfront textures only use the remaining margin; when the pressure rises, monuments switch to their lightweight form (their measured reservation goes from 160 to 29.42 MiB). The default internal ceiling was also lowered to 472 MiB to keep a safety margin against instantaneous WebGL peaks.
On the measured route to Notre-Dame, U-turn included, the number of detailed tiles resident at the checkpoint goes from 0 to 4, for a measured WebGL peak of 485.70 MiB, zero console errors and a standstill frame interval of 16.8 ms at the 95th percentile (about 60 frames per second).
Continuous façades on sloping ground
On quai Saint-Bernard, an 8 m high brick building set on an embankment showed a huge diagonal tear through which you could see the garden behind. The ground varied from 28.07 to 33.43 m in altitude along its outline, with a bump in the middle of one wall creating a measured 1.12 m gap.
The problem came from the old vertical draping: each vertex of a wall followed the local ground altitude, then the distortion faded out going up towards the roof. When a long wall section met several small segments at a corner, their heights diverged and the façade split open. On low buildings, the slope even flipped triangles inwards. A sweep of 7 hilly sectors (quai Saint-Bernard, Montmartre, Belleville, Buttes-Chaumont, Butte-aux-Cailles, Sèvres and Meudon) covering 2,216 buildings, 897 of them without an open passage, measured 542 gutted buildings and 24 with inverted triangles.
The shared fix is simple: the whole body of the building, windows and roof included, starts straight from the highest ground level under its walls, while a solid base goes down to 16 cm below the lowest level. Doors and shop windows keep their real threshold at street level. Across the 2,216 buildings checked again, the 542 gaps and the 24 inversions fall to 0, for a calculated geometry memory overhead of only +0.60% and an unchanged pace of 16.7 ms at the 95th percentile.
184 Seine bridges in 58 KB and 220 real shop signs
The river poses the mirror-image challenge: bridges must stay recognisable without weighing down the scene. An open catalogue lists the 184 structures over the Seine in 58,048 bytes (52 arch bridges, 117 decks on piers, 11 metal trusses, 3 cable bridges and 1 hybrid structure). Each tile draws them in 1 to 2 draw calls, shadows included.
Here again, visual inspection revealed a trap hidden in the open data. At the Pont au Double, right in front of Notre-Dame, the central axis was correctly tagged as a bridge at around 34 m altitude, but its wide pedestrian outline was classified as a ground surface. The pedestrian strips therefore followed the riverbed at 27.3 m, creating a deck collapsed into the water with submerged street lamps.
By automatically attaching any closed pedestrian outline that overlaps the water to its bridge axis, and discarding any lamp post standing in the water without a recognised support, the defect disappeared at the Pont au Double, the Pont Saint-Michel and the Passerelle de l'Écluse in Saint-Denis. The same pass corrected excessive cross-slopes on towpaths: at Port de la Tournelle, the cross-slope of a 3 m wide footpath goes from 36.37% to a measured 10.18%.
At pavement level, the city also shows 220 real shop signs spread over 14 families of shops (234 textures checked by fingerprint), loaded progressively when available memory allows. Keeping real brands visible in the street immediately improves orientation without resorting to a cartoon style.
Summary of visual fixes measured in Chrome (1440 × 900)
| Topic | Before | After |
|---|---|---|
| Nearby tiles (Tournelle) | 0 detailed tiles resident, 160 MiB blocked by monuments (measured) | 4 tiles resident, 29.42 MiB for monuments, 485.70 MiB WebGL peak (measured) |
| Façades on slopes (7 sectors) | 542 gutted buildings out of 897 without access, 24 inverted triangles (measured) | 0 gutted buildings, 0 inverted triangles, +0.60% geometry (measured / calculated) |
| Seine bridges | Pedestrian outlines in the water at Pont au Double, 36.37% cross-slope at Tournelle (measured) | 184 bridges in 58 KB, clear water, 10.18% cross-slope, 440.38 MiB peak (measured) |
All measurements were taken in Chrome with hardware acceleration on a 1440 × 900 screen, with zero console errors and zero WebGL errors.
What is still imperfect in the 3D view
- During fast travel at 25 m/s along the Seine, the frame interval at the 95th percentile still rises to a measured 50 ms when several detailed tiles are built in a row, even though it returns to 16.8 ms at a standstill.
- The 184 Seine bridges follow four simple architectural families: sculptures, ironwork and stone-cutting details remain out of scope, and a few grey strips under the deck (as at the Pont du Maréchal-Juin) still need diagnosis.
- Visual quality still depends on the original public data: noisy terrain or a poorly described bridge on the map forces us to write reliable generic rules, as the next article shows.