Engineering Pure-Code Short Videos

    A practical guide to producing short films entirely from code: visual concept, timeline, render pipeline, reproducibility, performance budgets, and evaluation criteria when external assets and generative media APIs are forbidden.

    Procedural video is not finished when you “write an effect.” Visual concept, timing, render pipeline, and reproduction notes must live under the same engineering constraints. When the brief forbids external assets and generative media APIs, every pixel must come from math, procedural textures, particle or fluid approximations, shaders, and synthesized audio. Judge the work by whether it is truly code-only, whether it reruns in a clean environment, whether the visuals tell a story rather than pile effects, whether technical depth is real, whether the project is maintainable, and whether performance is stable.

    Define the piece before stacking techniques

    A short that lands usually has a one-sentence visual idea: light seeking an exit in closed geometry; a noise field sliding from order into turbulence and back to symmetry. Aim for 30–60 seconds at 1920×1080, 30 fps—about 900 to 1,800 frames. That scale supports a beginning, middle, and end without offline render on a single machine going out of control.

    Split the narrative into four beats. Open with low contrast and a slow camera to establish space. Develop the main motion: particles pulled by a field, or fractal layers revealing in sequence. Peak with higher saturation, camera speed, or post intensity, but keep one visual protagonist. Close on symmetry or stillness so the ending feels complete, not cut off. Write a short table for camera, color, and composition: no more than three main colors, accent color only at the peak; foreground occlusion, mid-ground subject, background layers; easing on camera paths, not linear interpolation.

    Keep the concept note under 200 words and answer three things: what world this is, what the viewer should feel, and which technical device carries the story rather than decoration. Go deep on at least one hard technique: procedural materials, lighting and shadow, particle or fluid approximation, fractals, post-processing, or audio-driven visuals. Sampling many effects is usually worse than finishing one field-driven system.

    Pure-code bounds and a reproducibility contract

    Write the hard bounds as acceptance criteria. No reading external images, video, or audio. No text-to-image, text-to-video, or generative audio APIs. All pixels and samples are computed. Allowed: deterministic math, seeded PRNG, shading, procedural synthesis. Unseeded random splits two exports and fails reproduction.

    Delivery is more than pseudocode or effect descriptions. A minimal reproducible project includes source, dependency version ranges, one-click or a few run commands, render/export commands, output path or frame naming, and mux/packaging steps. Browser setups should provide a single-page entry and how to open it offline, without remote scripts. Image-processing or CLI setups should document environment, working directory, and checkpoints on failure. If length is capped, get the core look running first, then documentation—not the reverse.

    Name frames uniformly, e.g. frame_0001.png through frame_1800.png, and lock color space and pixel format in the docs. Mux only packages and states constant bitrate or quality; it does not generate new pictures. Reviewers can check frames alone or the finished file alone.

    Technical approach and hard problems

    Normalize time t to 0–1 so every animation parameter is a function of t. Changing duration then does not rewrite logic. Split the scene into field, material, and post. The field owns particle position or density; materials own color and roughness; post owns bloom, tonemap, and vignette, with strength varying by beat.

    A particle system is a solid backbone. Each particle stores position, velocity, and lifetime. Velocity comes from a noise field or stacked attractors. To avoid O(n²) all-pairs work, bin space into a grid and query neighbors, or approximate fluid with a few vortex centers. Depth comes from size, alpha, and sort order—not endless particle counts.

    Lighting need not be full path tracing. One key directional light plus ambient, with simple shadow or occlusion, is enough for volume. Fractals work as background structure: iteration count follows t; drop iterations in the distance. Mix value noise, gradient noise, and Voronoi distance for materials; keep frequencies modest or 1080p will sparkle.

    If audio is required, synthesize it: oscillators, envelopes, filters, fixed sample rate, same timeline driving visual peaks. Do not import finished audio files. Audio energy only modulates existing parameters (emission rate, bloom radius) so picture and sound are not two unrelated random streams.

    Hard problems usually fall in three buckets. Temporal stability: high-frequency noise with jumping phase between frames flickers; smooth noise coordinates to the frame rate or lower the top frequency. Determinism: same seed, resolution, and frame order must be comparable; watch reduction order under parallelism, or disable non-deterministic opts in export. Mux consistency: frame images and the packager must agree on fps and pixel size or the file will speed-shift or artifact.

    Keep the core loop library-agnostic:

    1. for frame in range(total_frames):
    2. t = frame / (total_frames - 1)
    3. scene.update(t, seed=fixed_seed)
    4. image = scene.render(width, height, quality=budget)
    5. image.save(f"frames/frame_{frame:04d}.png")

    Performance budget and fallbacks

    Write the budget before the look. Example: export the full piece on one machine in acceptable time—caps on particles, fractal iterations, blur radius, and supersampling. Interactive preview at quarter resolution, half particles, bloom off; full quality only on final export. Fix the fallback order: cut supersampling first, then particles, then fractal iterations, then post, so a downgrade does not erase the main form.

    Stream frames to disk; do not hold the whole sequence in memory. Checkpoint long renders and resume from the last finished frame. Log per-frame time; if many frames miss budget, drop one quality tier automatically and document it. A complete piece beats a perfect single frame.

    Self-evaluation

    Visual impact: a clear peak; color and composition serve the idea, not “always bright.” Technical difficulty: the chosen hard technique actually forms the picture; remove it and the concept collapses. Code quality: module boundaries, names, seed and parameters in one place. Reproducibility: a newcomer following the docs gets the same-named film or same-rule frame sequence from an empty directory. Performance and stability: finished inside budget; still watchable after fallback.

    Under this bar, a pure-code short becomes a handoff: the idea can be told, the picture generated, commands rerun, quality degraded, and the score checked. That is the professional standard when creative tech and graphics programming meet.