Skip to content

Realism layer: real footage, path-traced 3D layers and edit pairs - #1

Open
MING-ZCH wants to merge 8 commits into
mainfrom
realism
Open

MING-ZCH wants to merge 8 commits into
mainfrom
realism

Conversation

@MING-ZCH

Copy link
Copy Markdown
Owner

Summary

Adds a realism layer to Code-to-Video: the program stays the source of truth (frames are still pure functions of (t, params), byte-reproducible), but the pixels it composes can now be real footage, path-traced 3D and a camera finish. Targets the categories the painted engine could not reach: real human motion, 3D anthropomorphic characters, physics, visual effects, world knowledge, title sequences and special styles on real pixels. Also turns controllability into data: c2v pairs renders source/target edit pairs with exact masks.

before/after

New tools

  • c2v assets (lib/assets.mjs): search/fetch from Wikimedia Commons, NASA, Poly Haven (CC0 HDRIs, PBR textures, models), Internet Archive, Pexels/Pixabay (with key), direct URLs (incl. .glb). Licence, author, page and sha256 go to projects/<p>/assets.lock.json (committed); media under assets/ is not. restore re-fetches and refuses changed downloads; --interp=N adds motion-compensated in-betweens (ffmpeg minterpolate) for slow motion; NASA items carry their metadata as facts.
  • engine/real.js: footage() (source time under the virtual camera, chroma key, screen/add/lightest/darkest), speedRamp(), handheld(), grade() (tone curve, temperature, bloom, halation, aberration, defocus, grain, letterbox), PROJECT.shutter sub-frame motion blur, PROJECT.look = 'real'; P() edit params from PROJECT.params + ?params=.
  • c2v blender (blender/): Python scene files rendered in Cycles (Metal/OptiX/CUDA/HIP) — HDRI, PBR, Bullet rigid bodies (baked, kinematic releases), Mantaflow fire/smoke with blackbody flame colour, ember particles, shadow catcher, glTF characters with NLA-blended actions, material restyling, and an optional measure(ctx) hook whose result (e.g. impact frames) lands in the layer meta for sound sync.
  • c2v pairs (lib/pairs.mjs): one target video per param edit next to a shared source, exact difference masks, pairs.jsonl with zh/en instructions and changed-frame stats; sweep samples single-parameter edits from a declared space; --export writes source/target/mask keyframe triplets; --list dry-runs.
  • stylize('oil') (Kuwahara + canvas + impasto); macOS Playwright Chromium detection.

Probes (all selftest PASS, check 0 errors)

Project Categories Picture
real-motion human motion · title · text · style Commons gymnastics footage: title with focus pull, 0.25× motion-interpolated slow motion + push-in, lower third, ink-wash restyle + seal
real-physics physics · title · 3D path-traced metal letters released under Bullet gravity; variants: glass, rubber, Moon gravity (fall times match √(2h/g))
real-world world knowledge NASA Artemis I launch; mission, date, pad read from the NASA item's metadata; mission clock
real-vfx visual effects Mantaflow explosion + embers + rigid debris composited into an 8k HDRI plate with a shadow catcher
real-human 3D anthropomorphic · 3D human toy robot acting on a desk shot like a macro photo (85 mm f/2); mocap-driven dancer
real-domino physics 68 Bullet dominoes round a heart built from arcs + tangents, turning red as they fall; clicks at the simulation's own impact frames (22.3 plaques/s)

Edit pairs produced

real-motion 24 (8 hand-written + 16 sampled), real-physics 4, real-human 3, real-domino 1. Masks are local where the edit is local (e.g. title text 0.9 % of the area on 85/240 frames; robot repaint 5.1 % on its 141 frames).

Tests

node tests/run.mjs ALL PASS · node tests/replay.mjs 7/7 historical failures caught · selftest PASS on all six probes.

Limits

  • Photoreal scripted humans are not covered: free rigged characters are stylised or toys; needs scanned rigged humans (MPFB/SMPL-X) + mocap retargeting.
  • No camera tracking: CG cannot be placed into moving footage.
  • Mantaflow fire is improved (blackbody colour, embers) but not film-grade at this resolution.
  • Masks use a fixed threshold: subtle global edits (small temperature shifts) are under-masked; use the param diff for global edits.
  • Cycles' Metal kernel loader crashed twice when Blender shared the GPU with the Chrome renderer; running Blender alone avoided it (cause not established).
  • Rendered media and fetched assets are not committed; c2v assets <p> restore and the c2v blender commands in each lock entry rebuild them.

MING-ZCH and others added 2 commits November 12, 2026 19:10
…e/real.js (footage, speedRamp, grade, shutter blur), c2v blender (Cycles PBR, Bullet, Mantaflow, glTF + NLA, measure hook), c2v pairs (edit pairs, masks, sweeps, keyframe export), oil style

Co-authored-by: Cursor <cursoragent@cursor.com>
…-human, real-domino), docs/realism.md, README sections, research log R1/R2

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

MING-ZCH and others added 6 commits November 12, 2026 23:06
…ask, Cycles misty moor, Temelín steam) and real-mobius (parametric Möbius solid, ant on the surface normal); footage mask via 2D canvas compositing, film scratches in grade(), silhouette extraction script

Co-authored-by: Cursor <cursoragent@cursor.com>
… model, procedural pad, volumetric exhaust and steam) and cg-gym (MPFB human, IK grip, energy-conserving giant swing); camera clip_end; zip assets; research log R3

Co-authored-by: Cursor <cursoragent@cursor.com>
…t eval matching Brush, code-driven camera/edits/inserted splats), splat-garden; cg-grasp interaction probe (contact solver vs fixed grip, penetration/volume/gap measures); github asset source pinned to commits; Rocketbox humans with fixed Biped tails; pairs base params; review fixes; research log R4

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ttoms, footprint separation, rest pose, sweep + minimum-energy placement, Bullet settling, checks) vs naive layouts; c2v three (three.js raster / GTAO / three-gpu-pathtracer on exported glTF) compared with Cycles; Rapier rigid-body shot with per-frame penetration; research log R5

Co-authored-by: Cursor <cursoragent@cursor.com>
…ingual subtitles, original sound under the same cut list), film-cafe (Rocketbox people retargeted by world rotation, chair/table/floor contact solved and measured), film-street (walk speed solved from planted feet, rotation-only camera); render invalidates stale frames by input hash; restore hint for archive-range cuts; research log R6

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants