~/blog/taipei-fpv-game

AI Workflow · part 34

[AI Workflow] Building a 21-second Taipei FPV race from OpenStreetMap

❯ cat --toc

TL;DR

I made a 21-second FPV race through Xinyi, Taipei, with OpenStreetMap and Blender. The camera path drives the lap timer, checkpoints, speed and minimap. After the finish, the HUD drops out and a depth-guided MiniMax H3 shot takes over the climb past Taipei 101.

A banked close-up of the green-lit spire of Taipei 101 against a blue evening sky in the H3 reveal

The 21-second race. The photoreal Taipei 101 at the end is AI-generated.


One Blender camera drives the flight and the race

I wanted the race timer and the checkpoint chime to agree with what the viewer sees. When the camera crosses a ring, the score changes on that crossing and the chime plays at the same time. I kept the Blender camera path as the source for all of it, including the depth footage for the final shot. I got the idea from Leaf (@leaf_sanren), who used Blender and Colab for a night FPV flight through Hong Kong. I used the same map-to-scene approach for a course around Taipei 101.

You’ll need Blender and ffmpeg for the flight. Grab an OpenStreetMap extract for your city and a digital elevation model for terrain. For this build I used Geofabrik’s Taiwan extract and Copernicus DEM. I used Colab compute units (CU) to rent an L4 for the first Blender and H3 run. If you want to follow the cloud setup, have Colab CLI available and check the budget before allocating the GPU. The final look also needs ComfyUI with MiniMax H3 and the depth control model.

Start with a top-down check of the map

I cropped to the streets around the landmark and projected the building outlines, roads and terrain into local coordinates in meters. To extrude a footprint into a building, take its height tag when present, convert building:levels when there’s a floor count, and mark the rest as estimates. Export an overhead view before spending time on windows or camera animation. I checked that the tower and the roads would line up when seen from street level.

North-up map preview showing the Taipei 101 footprint and the surrounding Xinyi street grid
The overhead render is a quick check on the footprint, street grid and north alignment. Map data © OpenStreetMap contributors.

Set the turns and clearances before the full render

My route starts above the buildings, drops into the street, banks between facades, then climbs while turning back to face the tower. I used a 16 mm lens. To sell the turn, put a near object on the edge of the frame so it sweeps past while the distant street stays readable. Turn on motion blur for the render, and use a cheap preview to judge the route first.

Then check the evaluated camera positions against the building volumes and the ground. A gap at the keyframes can close when Blender interpolates between them. Once the path clears the geometry, render the full sequence in EEVEE. If you use Colab, confirm that Blender sees NVIDIA EGL and encode the frames on the rental before you download the video.

Use the checkpoint crossing to cue the effects

Put the ring centers on the route and orient each ring across the direction of travel. In my scene, there are six rings. For each crossing, intersect the segment between consecutive camera positions with the plane of the ring. Check whether that point is inside the opening. I used the resulting timestamp to cue the flash, chime and +100 score update.

Think of a basketball going through the hoop. The camera starts in front of the ring in one frame and ends up behind it in the next. It counts only if the line between those two positions goes through the opening. Flying through backwards doesn't count.

Diagram: on the left, the line between the previous and current frame passes inside the ring and scores 100; on the right, the line passes above the ring and does not score
Join consecutive camera positions; only a line through the opening counts.
Race frame with a glowing ring, the checkpoint counter and score at the top, and speed, altitude and minimap panels at the bottom
A single crossing event advances the counter and score. The speed, altitude and minimap panels update from the evaluated camera pose.

For speed, take the distance between the evaluated camera positions on either side of the current frame and divide it by the time between those samples. Multiply meters per second by 3.6 for km/h. Subtract the terrain elevation at the same XY position from the camera elevation to get height above ground. The minimap uses the scene’s XY coordinates for the track, camera and next ring. I simulated the battery independently.

The finish freezes the timer, shows the score and clears the HUD with a brief glitch. I rendered the Z pass for that same climb, which records distance from the camera for each pixel, and converted it to a depth clip with near surfaces bright and far surfaces dark. The first H3 climb used start and end frames, and it kept much of the original Blender look. I switched to H3 Fun ControlNet Union and fed it the depth clip to guide the motion while it redrew the lighting and surfaces. You can see the cut where the spire, sky and some nearby buildings shift. I cut to the H3 shot as the HUD glitches out. H3 ControlNet model card

Matched frames with Blender on the top row and H3 on the bottom. A street run is on the left and a climb alongside Taipei 101 is on the right.
The bottom-left frames use start and end images as guidance. The bottom-right frames use the Blender depth pass for the tower climb.

Give your agent a landmark and a route to preview

Paste this into an agent that can run Blender, ffmpeg and Colab CLI. Swap in a place you know and describe how you want the camera to approach it.

Make a 21-second vertical FPV race short around [city or landmark] at 1080×1920 and 24 fps. Use a virtual Blender camera throughout. Pull OpenStreetMap footprints and roads and use an open DEM for the terrain. Build heights from height, then building:levels, then clearly marked estimates. Show me a top-down preview with the landmark and main streets first.

Block out a wide-angle dive, a low bank through the streets and a climb back toward the landmark. Add motion blur and send a low-res contact sheet. Check the evaluated path against the terrain and building volumes before the full render. For a Colab L4 run, confirm available compute units and idle sessions, set a budget and shutdown limit, and confirm NVIDIA EGL in the log. Encode the PNGs to H.264 MP4 on the render machine, then download the MP4 and verify its SHA-256.

Add glowing rings to the camera route. Use the intersection of the camera segment and each ring plane to identify a crossing inside the opening. Use that timestamp for the score, flash and sound. Derive speed from camera positions and altitude above ground from the terrain. Use the scene coordinates to put the route, player and next ring on the minimap.

Add a countdown, rotor sound and a finish screen. Clear the HUD after the last ring and cut to a realistic climb guided by the same Blender Z pass through MiniMax H3 Fun ControlNet Union. Preserve the OpenStreetMap credit throughout and label the clip as a simulation.

Deliver the Blender render, H3 shot, final cut, overhead image, contact sheet and source credits. Check the duration, dimensions and audio with ffprobe. Review the crossing events and cut, stop the Colab rental, and record the active sessions and actual compute units with colab sessions and colab usage.

Deep dive: What changed between the first render and the race cut

You can skip this section if you’re following the workflow above.

Why the first pass felt slow

I checked the turn in a low-res pass with a near object at the side of the frame. The final roll ranged from about −24.6° to +27.9°. After fixing two intersections in the first pass, I checked 480 camera samples against the ground and building geometry. For a preview that still looks like a security camera, I’d look at the dive, bank and foreground clearance before turning up the render resolution.

What does an hourly rate actually buy?

The first L4 rental was billed at 2.33 CU per hour and used 1.12 CU including setup, Blender and H3. A lower hourly rate on a T4 can cost more for the same job if the render takes long enough. Time the same frame range in the same scene with identical render settings, then multiply each runtime by its hourly rate. I have a measured L4 run for this scene. A T4 comparison would need that second run.

When I went back to add the race, L4 allocation requests returned HTTP 503. I rendered 407 race frames in Blender on my Mac at home and reused the earlier H3 ending. That race run cost 0.00 Colab compute units.

Finish the encode where the PNGs already are

The EEVEE render of 480 frames took 6 minutes 53 seconds. H.264 encoding on the Colab VM took 20 seconds. I pulled the encoded MP4, checked its SHA-256 and retrieved individual frames when I needed generation inputs. The render log gives the encoding time. There’s no measured PNG download time for this run.

Map data © OpenStreetMap contributors, licensed under the ODbL. OpenStreetMap copyright and license · Geofabrik Taiwan extract

Terrain derived from Copernicus DEM GLO-30. Copernicus DEM license and attribution

produced using Copernicus WorldDEM-30 © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved

For more on planning the camera route, see how I used Blender blockouts for FPV across Taiwan.

FAQ

Can I make the Taipei FPV race without a Colab GPU?
The race section was rendered on a Mac after Colab returned HTTP 503 during L4 allocation. It reused a MiniMax H3 shot from an earlier run. You can render the race with Blender and ffmpeg locally and run the H3 pass wherever you can load the model.
How many Colab compute units did the Taipei FPV project use?
The original Blender and H3 run used 1.12 compute units. The later race run used 0.00 compute units because the L4 allocation failed and the race footage was rendered locally.

Read next

Don't miss the next one

Subscribe, and you won't.

One-click unsubscribe anytime.