feat: persistent scene schema - #6
Open
juniorxsound wants to merge 4 commits into
Open
Conversation
E2E: Renderer CPUPASS • google / swiftshader Captured render JSON{
"outputPath": "/out/BoxVertexColors-preview.png",
"diagnostics": {
"width": 512,
"height": 512,
"readbackFormat": "rgba8unorm",
"alpha": true,
"antialias": true,
"runtime": {
"requestedAt": "2026-07-07T11:42:26.257Z",
"powerPreference": "high-performance",
"dawnFlags": [
"backend=vulkan"
],
"adapterRequestMs": 2.36874899999998,
"deviceRequestMs": 1.8030459999999948,
"adapterInfo": {
"vendor": "google",
"architecture": "swiftshader",
"device": "swiftshader-device-subzero-",
"description": "SwiftShader driver 5.0.0"
}
}
},
"inspection": {
"path": "/models/BoxVertexColors.glb",
"format": "glb",
"byteLength": 1924,
"scenes": 1,
"nodes": 1,
"meshes": 1,
"materials": 0,
"textures": 0,
"images": 0,
"animations": 0,
"cameras": 0,
"extensionsUsed": [],
"generators": [
"JglTF from https://github.com/javagl/JglTF"
]
}
}
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new persistent “scene document” package (@rendergl/headless-three-webgpu-scene) and wires it into the CLI via --json, enabling reusable JSON-defined scenes (assets/objects/cameras/views/sequences/tracks) alongside some core renderer readback enhancements needed for additional render passes.
Changes:
- Add
packages/scenewith Zod schema validation, evaluation/interpolation, and rendering helpers (including multi-pass rendering). - Extend the CLI to support
rgl render --jsonandrgl video --jsonflows (plans + execution + docs/tests). - Improve core readback APIs (readback format selection, read-pixels colorSpace, renderPipeline support) and related tests/docs.
Reviewed changes
Copilot reviewed 23 out of 25 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds --json usage examples for render/video. |
| pnpm-lock.yaml | Adds workspace linkage for the new scene package and its deps. |
| packages/scene/tsconfig.json | TypeScript config for the new scene package. |
| packages/scene/package.json | Declares the new published @rendergl/headless-three-webgpu-scene package. |
| packages/scene/src/index.ts | Public API surface re-exports for scene schema/eval/render helpers. |
| packages/scene/src/schema.ts | Defines the persistent scene document schema and validation/refinements. |
| packages/scene/src/evaluator.ts | Evaluates tracks over time into an evaluated scene state; summarization + duration helpers. |
| packages/scene/src/interpolation.ts | Keyframe sorting + interpolation (linear/hold/bezier) utilities. |
| packages/scene/src/render.ts | Loads scene documents, prepares a Three scene graph, and renders single/multi-pass outputs. |
| packages/scene/test/schema.test.ts | Coverage for schema parsing/refinement + evaluation behavior. |
| packages/core/src/types.ts | Extends renderer types to support readback options and pipeline rendering. |
| packages/core/src/renderer.ts | Implements selectable readback targets and readPixels/toBuffer options + renderPipeline. |
| packages/core/src/readback.ts | Optimizes row deflation and adds HDR->linear byte conversion helpers. |
| packages/core/src/index.ts | Updates public type exports for new readback/pipeline APIs. |
| packages/core/test/readback.test.ts | Adds tests for new/updated readback helpers. |
| packages/core/README.md | Documents readback format defaults and HDR/precision note. |
| packages/core/agent/skills/rgl-core/SKILL.md | Updates skill docs to reflect readback format behavior. |
| packages/cli/package.json | Adds dependency on the new scene package. |
| packages/cli/src/scene-commands.ts | Adds plan builders for scene-document render/video CLI flows. |
| packages/cli/src/scene-video.ts | Implements --json video rendering loop using prepared scene renders. |
| packages/cli/src/index.ts | Adds --json flag handling to render and video commands. |
| packages/cli/test/scene-commands.test.ts | Tests for scene render/video plan building logic. |
| packages/cli/README.md | Documents new --json render/video usage. |
| packages/cli/agent/skills/rgl-cli/SKILL.md | Updates skill docs to include scene JSON document support. |
| .gitignore | Adds additional output directories. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Added persistent scene-document schema package and a
--jsonparam to the CLI so scenes can define assets, objects, cameras, views, sequences, tracks, and render pass metadata in one reusable format.Related Issue
Fixes #XXXX (if applicable)
Type of Change
Checklist