Skip to content

Support reading lcc2#258

Merged
slimbuck merged 2 commits into
playcanvas:mainfrom
xgrids:feat/xgrids_lcc2_support
Jun 12, 2026
Merged

Support reading lcc2#258
slimbuck merged 2 commits into
playcanvas:mainfrom
xgrids:feat/xgrids_lcc2_support

Conversation

@xgrids-devteam

Copy link
Copy Markdown
Contributor
  • Added the readLcc2 function to parse an XGrids LCC2 scene consisting of a meta.lcc2 descriptor and separate .sog/.spz data block files.

  • Added the src/lib/readers/read-lcc2.ts file: parses the meta.lcc2 file (including old and new protocol field names), collects the data block file index for each LOD level, decodes data blocks by reusing readSog/readSpz, merges data blocks using the combine function, applies LCC v1 coordinate transformations, and loads optional environment data blocks.

  • Implemented multi-LOD selection via options.lodSelect and the lod column, consistent with the behavior of readLcc.

  • Integrated lcc2 into the read pipeline (getInputFormat/InputFormat/readFile), and exported the readLcc2 function from readers/index.ts and lib/index.ts.

  • Updated the CLI instructions and README file to document .lcc2 input.

…pensource/playcanvas/splat-transform into feat/xgrids_lcc2_support

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for reading XGrids LCC2 (.lcc2) files (octree, multi‑LOD chunked .sog/.spz) across the library and CLI, including helper utilities and unit tests for meta parsing and LOD resolution.

Changes:

  • Implement new readLcc2 reader with meta parsing, LOD selection, chunk traversal, and bounded-concurrency decoding.
  • Wire .lcc2 into format detection and public exports; update CLI/README docs.
  • Add unit tests for LCC2 meta parsing + pure helper functions.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/read-lcc2.test.mjs Adds unit tests for LCC2 meta parsing and helper utilities.
src/lib/readers/read-lcc2.ts Implements LCC2 reader + helper functions (parse/LOD selection/decoding).
src/lib/readers/index.ts Exposes readLcc2 from readers barrel.
src/lib/read.ts Adds .lcc2 detection and dispatch to readLcc2.
src/lib/index.ts Exports readLcc2 from public library API.
src/cli/index.ts Updates CLI help text to include .lcc2 and shared LOD option wording.
README.md Documents .lcc2 support and shared LCC/LCC2 input options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/readers/read-lcc2.ts Outdated
Comment thread src/lib/readers/read-lcc2.ts Outdated
Comment thread src/lib/readers/read-lcc2.ts Outdated
Comment thread src/lib/readers/read-lcc2.ts
Comment thread src/lib/readers/read-lcc2.ts
@wszxdhr

wszxdhr commented Jun 12, 2026

Copy link
Copy Markdown

🚀🚀🚀🚀

@slimbuck slimbuck changed the title support lcc2 Support reading lcc2 Jun 12, 2026
@slimbuck

Copy link
Copy Markdown
Member

Hi and thanks for this PR.

Please merge latest main into this branch (as I can't do it myself) so we can this merged!

@slimbuck slimbuck merged commit ca8d66b into playcanvas:main Jun 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants