Skip to content

feat(capture): shared local Clay previews and dollhouse rendering - #788

Merged
Aymericr merged 3 commits into
mainfrom
feat/capture-clay-review
Sep 8, 2026
Merged

Aymericr merged 3 commits into
mainfrom
feat/capture-clay-review

Conversation

@Aymericr

@Aymericr Aymericr commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Capture previews above 6,000 faces were rejected even though the recorder permits 20,000. Align validation with the native budget while retaining byte-length and index checks, and expose a small shared geometry/matcap entry point so hosts can display a locally saved Clay preview before upload.

Add optional host-controlled Clay and dollhouse presentation to capture layers. Dollhouse changes cloned per-instance materials; default rendering stays compatible. Browser/React Native source exports support packaged offline DOM previews without generated workspace artifacts.

How to test

  1. bun test packages/capture-protocol/src packages/capture-viewer/src — 41 tests pass.
  2. bunx tsc --build packages/capture-protocol packages/capture-viewer and bunx biome check packages/capture-protocol packages/capture-viewer.
  3. In a consuming viewer, load a native surface preview with more than 6,000 faces, enable Clay/dollhouse, orbit and resize, then toggle back to recorded colors. Check a room GLB with dollhouse on and off.

Architecture review: the protocol retains plain validated data; Three.js geometry/material helpers stay in capture-viewer; the host owns controls, access, transport, and lifecycle. No new editor-state dependency or node kind.

Screenshots / screen recording

Visual checks use a private capture in the consuming app, including an offline packaged preview and native simulator. Private scan artifacts are not attached to this public repository.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style
  • I've updated relevant documentation
  • This PR targets the main branch

Note

Medium Risk
Protocol validation now accepts much larger surface meshes, which affects memory and parsing for all consumers; rendering changes are opt-in but touch shared layer and room-model material cloning.

Overview
Raises capture-protocol surface-mesh validation from 6,000 to 20,000 faces (and scales the indices payload cap) so manifests match the native recorder budget; tests now assert acceptance at 20k and rejection above it.

Adds @pascal-app/capture-viewer/preview with createSurfaceMeshGeometry, createClayMatcap, and shared decode logic (protocol-validated, returns null on bad input). Browser/React Native package exports resolve source so offline DOM bundles skip workspace dist.

CaptureStreamLayer (and custom stream renderers) accept optional meshPresentation: previewMaterial: 'clay' swaps vertex colors for a procedural matcap; dollhouse: true uses front-face materials on surface meshes and cloned room GLB/USDZ materials. Defaults preserve prior double-sided recorded-color rendering.

Reviewed by Cursor Bugbot for commit 51a66f2. Bugbot is set up for automated code reviews on this repo. Configure here.

@pascal

pascal Bot commented Sep 8, 2026

Copy link
Copy Markdown

I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…).

Please try again, rephrase, or reach out if it keeps failing.

Error id: 14274f0c-2a3f-4815-8b9f-daf9afaf05e0

@Aymericr
Aymericr merged commit 15e7b32 into main Sep 8, 2026
3 checks passed
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.

1 participant