Voxel Shorts Production Skill
Build vertical 1080x1920 (30 fps) 3D voxel videos entirely in code with Remotion (@remotion/three), Three.js, Edge-TTS, and FFmpeg.
Read references/pipeline.md for exact JSON contracts and render settings, and references/framing.md for 9:16 camera and UI safe-zone rules.
Core Rules
- Lock voiceover before animating. Never animate to guessed durations. Synthesize the narration first so every cut, camera move, and explosion binds to exact frame numbers from
beats.jsonandcues.json. - Keep every frame deterministic. Remotion renders frames out of order across parallel browser workers. Never call
Math.random()inside render oruseMemowithout a fixed seed, and never drive motion withDate.now()oruseFramedeltas. Compute everything strictly fromframeandfps. - Verify stills before rendering video. Always render 5-8 keyframe PNGs with
scripts/render_stills.mjsatscale: 0.5and inspect them visually before running a full MP4 encode. - Respect 9:16 platform safe zones. Keep hook banners, chapter badges, and captions clear of TikTok and YouTube Shorts UI chrome (top 12%, bottom 24%, right 14%).
- Use nearest-neighbor pixel textures. Set
magFilter = THREE.NearestFilter,minFilter = THREE.NearestFilter,generateMipmaps = false, andcolorSpace = THREE.SRGBColorSpaceon every procedural block or character texture.
Workflow
1. Write the Beat Script
Create a JSON script following starter/script.example.json:
- Split the story into numbered beats (
B01..Bnn). - Beat
B01is the hook: 3-6 words, direct premise, immediately readable on frame 0. - Set a short
gap(0.2s-0.5s) after beats that need room for a visual payoff or sound impact, and ~1.0s-1.3s on the final beat. - Map key sound/visual triggers to spoken keywords in
sfx_keywords.
2. Lock Voiceover and Word Timestamps
Run:
python scripts/generate_vo.py --script path/to/script.json --out-dir audio
This trims leading/trailing TTS dead air per line, stitches beats with exact pause durations, and outputs:
audio/vo.wav(48 kHz mono)audio/beats.json(per-beat start/end seconds and frames)audio/words.json(word-level timestamps with original punctuation preserved)audio/captions.srt
3. Build the Audio Mix and Frame Cues
Run:
python scripts/build_audio.py \
--audio-dir audio \
--public-audio public/audio/mix.wav \
--cues-out src/data/demo_cues.json
This generates:
public/audio/mix.wav: normalized narration, ducked procedural score, and word-aligned stereo SFX.src/data/<name>_cues.json: exactframes,beats,events, andwordsconsumed by the Remotion composition.
Customize scripts/build_audio.py when a scene needs different SFX (footsteps, lava, door slams, chimes) or different tension curves.
4. Compose the 3D Scene
Build a scene component under starter/src/scenes/ and register it in starter/src/Root.tsx:
- Wrap the 3D stage in
<ThreeCanvas width={width} height={height} shadows camera={{ fov: 50, near: 0.1, far: 140 }} gl={{ antialias: true }}>. - Pull block materials from
getMaterialBank()insrc/lib/textures.ts(memoized singleton). - Use
VoxelCharacter(src/lib/VoxelCharacter.tsx) for rigged bipeds with distinct color palettes and continuous breathing/walking/sprinting/action motion so characters never appear frozen. - Use
ExplosionFX(src/lib/ParticleFX.tsx) for deterministic blast/debris bursts. - Add brief screen impact flashes (5-8 frames) and decaying camera shake on major hits.
- Overlay
<Captions words={cues.words} />and<Audio src={staticFile("audio/mix.wav")} />.
5. Visual QA on Keyframes
Run:
node scripts/render_stills.mjs --comp YourCompId --frames 0,120,240,360,480
Inspect every PNG and confirm:
- Frame 0 displays the hook banner cleanly over an active 3D shot (never a blank black frame).
- Subject stays centered vertically and clear of caption text.
- Textures are sharp (no blurry mipmaps or missing materials).
- No camera clipping through walls or floor blocks.
6. Render Master and Web Exports
Run:
node scripts/render_video.mjs --comp YourCompId --out out/episode.mp4 --web
- Master MP4 uses H.264
yuv420pCRF 18 (good for YouTube Shorts). --webalso producesepisode_web.mp4(faststart, capped bitrate) so uploads stay under strict 50 MiB browser upload limits.
7. Optional Multi-Episode Compilation
For episodic stories, render each chapter as its own composition, then merge losslessly:
python scripts/assemble_series.py \
--inputs out/ch01.mp4 out/ch02.mp4 out/ch03.mp4 \
--out out/full_movie.mp4 \
--qa-sheet out/qa_sheet.png
Troubleshooting
- Black WebGL frames in headless Chromium: Ensure
chromiumOptions: { gl: "angle" }is passed toselectComposition,renderStill, andrenderMedia(already configured inremotion.config.tsand the starter scripts). - Textures look blurry: Confirm
NearestFilterandgenerateMipmaps = falseon allCanvasTextureinstances. - Audio out of sync after editing text: Always re-run both
generate_vo.pyandbuild_audio.pysocues.jsonandmix.wavupdate together. - TypeScript errors on JSON imports: Keep
"resolveJsonModule": trueintsconfig.json.