feat(animated-shorts): Three.js + Remotion shorts pipeline w/ local & router render modes#19
Open
ninan-versioning wants to merge 2 commits into
Open
feat(animated-shorts): Three.js + Remotion shorts pipeline w/ local & router render modes#19ninan-versioning wants to merge 2 commits into
ninan-versioning wants to merge 2 commits into
Conversation
Browser-side renderer consuming product_twin.usda from @shoploop/connector-shopify. Minimal USDA->scene-graph parser, r3f scene builder with procedural placeholder + external GLB/USDZ refs, ProductTwin/VariantSelector/Stage components, and a Varitea demo. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… router render modes Deterministic vertical ad shorts (9:16, 1080x1920) built from the same USD product twins as the live web renderer. Three.js scenes are embedded in Remotion compositions and driven entirely off the frame counter — frame-accurate, no drift. - Re-export parser + scene namespaces from @shoploop/twin-renderer (not duplicated) - Storyboard DSL + JSON schema, Remotion composer, ThreeCanvas bridge, local/open-imagine orchestrator, bandit RenderProvenance feedback - Kinfolk brand gating at compose time (refuses off-brand renders) - shoploop-shorts CLI + two checked-in Varitea storyboards Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@shoploop/animated-shorts— deterministic vertical ad shorts (9:16, 1080×1920, 6s/9s/15s) for Varitea, built from the same USD product twins the live web renderer uses. Three.js scenes are embedded in Remotion compositions and driven entirely off Remotion's frame counter — frame-accurate, norequestAnimationFrame, no drift. The same storyboard renders the same bytes every time.A short emits the identical
creative_pack.v1shape a still does, so the Thompson Sampling bandit joins shorts and stills by(twin_handle × preset)without caring which pipeline produced them.The five primitives
storyboard.v1.json)src/dsl/storyboard.tssrc/composer/Short.tsxsrc/three/ThreeCanvas.tsxsrc/render/orchestrator.tsRenderProvenance→BANDIT_QUEUE_PATH)src/feedback/observation.tsThe Three.js scene comes from the SAME
parser+scenebuilder as@shoploop/twin-renderer(re-exported as namespaces in this PR, not duplicated), so offline shorts and the live web twin stay pixel-for-pixel in agreement.Render modes — one output
local(default, dev, $0):@remotion/rendererheadless capture (gl: angle, software GL so it runs in CI/containers without a GPU).open-imagine: dispatches to the GPU router (POST /v1/render→ pollGET /v1/jobs/:id). The router'sblender_cpustub keeps this path at $0 in this PR.Both return the same Creative Pack — callers and the bandit never branch on where a short was rendered.
Kinfolk gating at compose time
brand_rules.jsonis enforced before the render. The orchestrator composes the scene for every variant the storyboard visits and scores it (palette / finish / camera); a storyboard that would emit an off-brand frame is refused withBrandRulesViolationand its reasons — never silently shipped.Storyboards
storyboards/varitea_jasmine_hero_6s.json— 6s hero, orbit camera, single lower-third overlay at 2s.storyboards/varitea_flavors_lifestyle_15s.json— 15s lifestyle, dolly-in, flavor flip at 5s & 10s (jasmine → hibiscus → genmaicha), centered end card.Cost
~$0/mo — local mode renders on-machine; router stub is CPU/$0.
Acceptance
shoploop-shorts render --storyboard storyboards/varitea_jasmine_hero_6s.json # → var/shorts/varitea_jasmine_hero_6s.mp4 (verified 1080×1920, 6.0s, H.264 CRF 18)Test plan
pnpm test— dsl schema · composer 1-frame · local MP4 render (>0 bytes) · router mock (POST body + polling) · Kinfolk refusal — 16 passedpnpm typecheckclean@shoploop/twin-renderertests stay green (14 passed)🤖 Generated with Claude Code