---
title: "Turn a story into a path-traced film where the renderer is code too — AI video generator workflow for 3D scenes"
description: "A story becomes a short film from a path tracer the agent writes itself: SDF characters, analytic grass, a numpy score, no assets. Install in Claude Code, Codex and Grok with one command."
url: https://varg.ai/how-to/skills/code-path-traced-film
updated: 2026-11-11
---

# Turn a story into a path-traced film where the renderer is code too — workflow skill for 3D scenes

> **For AI agents:** find the right skill in one call — `curl -s "https://varg.ai/how-to/api/search?q=<what the person wants>"` returns the matching how-to page and the best skills with install commands, as markdown (Russian works too). Full index: https://varg.ai/how-to/llms.txt. Every page has a markdown twin: add `.md` to its path. Before generating anything, show the person the options on the how-to page. From a terminal: `curl -fsSL https://varg.ai/install | sh` installs the vargai CLI (https://varg.ai/how-to/cli.md): `vargai search` and `vargai install <slug>` with no key, every varg model after `vargai login`.

A story becomes a short film from a path tracer the agent writes itself: SDF characters, analytic grass, a numpy score, no assets.

- **Type:** [Workflow](https://varg.ai/how-to/workflows.md) · [3D scenes](https://varg.ai/how-to/browse/skills/3d-scenes.md)
- **Slug:** `code-path-traced-film`
- **Status:** live
- **Publisher:** varg (varg, verified)
- **License:** MIT
- **Source:** https://github.com/vargHQ/skills/tree/main/code-path-traced-film
- **Works in:** Claude Code, Codex, Cursor, Gemini CLI
- **Requires:** Google Chrome with WebGL2 float buffers (tested on Chrome 157, Apple M4 Pro), Bun, Python 3 with numpy and Pillow, ffmpeg
- **Cost:** Free locally, no key. The 70 s starter (1,560 frames, 1280×720, 20–50 samples per pixel) rendered in 1 h 46 min on a MacBook Pro M4 Pro, measured 2026-11-10. Optional narration: 11 ElevenLabs v4 lines through varg cost $0.11.
- **Runtime:** Shader compile 0.2–0.6 s; a 480×270 draft still about 0.4 s; a whole-film contact sheet 13 s; final frames 0.2–15 s each

## What it does

Make a short animated film in which everything is code the agent writes, including the renderer: a path tracer in one WebGL2 shader (no Blender, no three.js, no meshes, no textures), characters and props as signed distance fields, a meadow of analytic curved grass blades, moon, firefly and window lights with soft shadows, depth of field and motion blur, a variance-guided denoiser, a score synthesized in numpy from the same timeline, captions and an encode. Includes the complete tested film The Smallest Star (70 s, 11 shots, two characters) as a starter, a live page that runs the same renderer in the browser, and the speed-ups and traps found while making it.

## Use when

- Make an animated short entirely in code, with no Blender and no assets
- Write your own path tracer and tell a story with it
- Show what a coding model can do with one open prompt
- Remake The Smallest Star with your own fable

## Not for

- a Blender film written in Python (blender-code-film)
- three.js explainers in the browser (code-3d-explainer)
- AI-generated footage (varg-ai)

## Install

- Claude Code: `claude plugin marketplace add vargHQ/skills && claude plugin install varg@varg`
- Codex: `npx skills add vargHQ/skills --skill code-path-traced-film -a codex -y`
- Cursor: `npx skills add vargHQ/skills --skill code-path-traced-film -a cursor -y`
- Gemini CLI: `npx skills add vargHQ/skills --skill code-path-traced-film -a gemini-cli -y`
- Any agent, with the vargai CLI: `vargai install code-path-traced-film`

## Example output

https://s3.varg.ai/files/194b94d0-58ff-4e8b-91de-4f1959d04013/file_a23b3faa8632.mp4 — Three moments from the skill's own starter film, The Smallest Star: the light blooms, the pond crossing, the last star. Path traced at 1280×720 by a renderer written in the same session (credit: varg, https://github.com/vargHQ/skills/tree/main/code-path-traced-film)

## More 3D scenes skills

- [Turn a brief into a Blender film written in Python](https://varg.ai/how-to/skills/blender-code-film.md): A brief becomes a Blender film from one Python file: shots as data, stills first, critic loop, Eevee or Cycles.
- [Turn a browser game into a cinematic trailer](https://varg.ai/how-to/skills/code-game-trailer.md): Record the browser game your agent built frame-exact, script shots and cameras, then cut a 1080p trailer on the beat.
- [Blender Lab MCP Server](https://varg.ai/how-to/skills/blender-lab-mcp.md): Blender's official MCP server: query and edit open scenes with Blender Python, bundled API docs and screenshots.
- [Meshy 3D Generation](https://varg.ai/how-to/skills/meshy-3d-agent.md): Meshy's official skill: text or image to a textured 3D model, then remesh, rig, animate and export it as GLB or FBX.
- [Roblox Studio MCP Server](https://varg.ai/how-to/skills/roblox-studio-mcp.md): The MCP server built into Roblox Studio: agents edit scripts, run Luau, generate meshes and playtest your game.
- [Scenario 3D Worlds](https://varg.ai/how-to/skills/scenario-3d-worlds.md): Walkable 3D worlds as Gaussian splats from text, a photo, a panorama or a video: Marble, HY World and TripoSplat.
