Skip to content

viewer: expose snapshot render channels - #644

Draft
thomas-yanxin wants to merge 1 commit into
pascalorg:mainfrom
thomas-yanxin:codex/snapshot-capture-channels
Draft

viewer: expose snapshot render channels#644
thomas-yanxin wants to merge 1 commit into
pascalorg:mainfrom
thomas-yanxin:codex/snapshot-capture-channels

Conversation

@thomas-yanxin

Copy link
Copy Markdown

What does this PR do?

Adds a backward-compatible captureChannels() API to the viewer snapshot pipeline. It returns same-camera color, albedo, view-normal, and linear camera-range depth captures for visual evidence and diagnostic consumers.

  • Reuses the existing scene MRT; the scene geometry is still rendered once.
  • Creates albedo/depth conversion pipelines and targets lazily, so existing capture() calls pay no extra resource cost.
  • Keeps display color as WebP and encodes the three data views losslessly as PNG.
  • Leaves the existing capture() API and output behavior unchanged.

How to test

  1. Run bun check.
  2. Run bun run check-types.
  3. Run bun run test.
  4. Start bun dev and confirm the editor and IFC routes load.

Additional browser smoke coverage rendered a lit box and floor through the WebGL fallback, then verified all four captures share dimensions, have the declared MIME types, and contain non-empty, visually distinct color/albedo/normal/depth data.

Screenshots / screen recording

No UI changes. The browser smoke test visually verified aligned color, unlit albedo, packed view-normal, and linear depth outputs.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've documented the public channel semantics inline
  • This PR targets the main branch

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