Communitygithub.com

voxel-shorts

Produce vertical 1080x1920 3D voxel shorts and multi-episode series from code using Remotion, Three.js, Edge-TTS word-boundary timing, procedural SFX/BGM, and word-synced captions. Use when creating 3D blocky/voxel animated stories without opening a game client.

What is voxel-shorts?

voxel-shorts is a Claude Code agent skill that produce vertical 1080x1920 3D voxel shorts and multi-episode series from code using Remotion, Three.js, Edge-TTS word-boundary timing, procedural SFX/BGM, and word-synced captions. Use when creating 3D blocky/voxel animated stories without opening a game client.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/poorsol/voxel-shorts-skill/tree/HEAD/skill/voxel-shorts

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

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

  1. 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.json and cues.json.
  2. Keep every frame deterministic. Remotion renders frames out of order across parallel browser workers. Never call Math.random() inside render or useMemo without a fixed seed, and never drive motion with Date.now() or useFrame deltas. Compute everything strictly from frame and fps.
  3. Verify stills before rendering video. Always render 5-8 keyframe PNGs with scripts/render_stills.mjs at scale: 0.5 and inspect them visually before running a full MP4 encode.
  4. 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%).
  5. Use nearest-neighbor pixel textures. Set magFilter = THREE.NearestFilter, minFilter = THREE.NearestFilter, generateMipmaps = false, and colorSpace = THREE.SRGBColorSpace on 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 B01 is 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: exact frames, beats, events, and words consumed 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() in src/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 yuv420p CRF 18 (good for YouTube Shorts).
  • --web also produces episode_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 to selectComposition, renderStill, and renderMedia (already configured in remotion.config.ts and the starter scripts).
  • Textures look blurry: Confirm NearestFilter and generateMipmaps = false on all CanvasTexture instances.
  • Audio out of sync after editing text: Always re-run both generate_vo.py and build_audio.py so cues.json and mix.wav update together.
  • TypeScript errors on JSON imports: Keep "resolveJsonModule": true in tsconfig.json.

Related Skills