Skip to content

five-on-it / apps/worker/src/preview

apps/worker/src/preview ​

A level's preview: the picture on its game's page (GAME_DESIGN §10.3), the level seen from straight above. renderPreview writes level data to a temporary folder and renders it in headless Blender (assets/blender/levels/preview.py: an orthographic camera over the whole ground, Cycles on the CPU, a PNG a few hundred pixels across) with a time limit; the generator renders every level it makes, and npm run level:previews (render-previews.ts) renders the bundled levels into apps/worker/previews/, which bundledPreview reads. A preview is a nicety: whoever asks for one copes without it.

This module loads nothing of the level pipeline, so the platform API reads the bundled previews through it (@foi/worker/preview) without loading the generator.

Interfaces ​

Variables ​

Functions ​