# film-street-bake: bake a Blender film street into game assets

> Only what the film camera sees is baked: colour once, and the light once per weather, using the film’s own weather setups.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Game creation](https://www.sandbase.ai/skills/games)
- Version: 0.1.2
- Page: https://www.sandbase.ai/skills/games/film-street-bake

## Install

Download the Skill package from https://www.sandbase.ai/skills/games/film-street-bake (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/film-street-bake bake my Blender street film for the film-street game
```

## How it works

1. **Snapshot the film and write bake.json** Film Street Bake starts from a Blender street that meets references/film-contract.md. A film whose script rebuilds the scene per state gets one snapshot per state from scripts/snapshot.py. Then write bake.json: project, out, frame, yield_to (a process to wait for, such as the film's render script), states with exactly one base, and objects such as dynamic, rigs, glass, people and flips.
2. **Test two objects, then bake everything** Run blender -b street.blend -P scripts/bake.py -- config=bake.json state=dusk samples=16 only=a,b and inspect out/albedo and the log lines FLIP auto and BAKED. Then scripts/run.sh street.blend bake.json bakes every state, encodes non-base albedo sets, the walk grid and the overhead wires. It runs Cycles on a local GPU in Blender 4.2+, with numpy and Pillow.
3. **Check the bake in the game** Copy out/assets into the film-street app's public/assets, run node slim.mjs there and open the game. Every state's log must end with DONE and contain no Traceback. Look for black sheets, confirm lamps keep their highlights, and check that walkgrid.json blocks people, pots and poles but not the kerb. Then match the look with film-street-look.

## FAQ

### What does Film Street Bake produce?

Film Street Bake produces game assets for film-street: per-object albedo, one lightmap set per lighting state using the film's own state functions, the street glTF, a sidewalk collision grid and the overhead wires. Sunset Street bakes dusk, night and snow lightmaps, while its storm state reuses the night set through the lm field.

### Does Film Street Bake change my film project?

No. Film Street Bake never writes into the film project: it bakes from a snapshot and imports the state functions with bytecode writing turned off. The yield_to setting lets it wait for a film render process, so it can run next to the film on the same machine.

### How long does Film Street Bake take?

Film Street Bake takes tens of minutes per lightmap state on a laptop GPU for its Sunset Street example, and Harbour Street took about 35 minutes per state. Cycles on the CPU also works but takes many hours. Supported device values are METAL, CUDA, OPTIX and HIP, and it was tested on Blender 5.2.3.

### Is Film Street Bake free to run?

Film Street Bake renders with Blender Cycles on your own hardware and calls no SandBase model, so a bake is not billed. It needs time, a GPU, and numpy plus Pillow for encode_albedo.py. To re-bake a few objects, delete their files and run bake.py with skip=1, or name them with only.

### What can Film Street Bake not capture?

Film Street Bake cannot capture view-dependent light such as glossy reflections and glass. The game adds wet reflections and light globes live, and other glints are lost. Only what the film camera can see is worth baking, so the backs of buildings stay unbaked and the game never shows them.

## Examples

- Bake a film street (image)
