Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native document format #389

Merged
merged 32 commits into from
Jan 28, 2025
Merged

Native document format #389

merged 32 commits into from
Jan 28, 2025

Conversation

slimbuck
Copy link
Member

@slimbuck slimbuck commented Jan 28, 2025

Fixes: #236
Related tickets: #324

This PR implements support for a native SuperSplat document.

The Scene menu has been updated to reflect document vs import/export:

Screenshot 2025-01-28 at 16 39 45

Document contents

The document is a simple uncompressed zip archive containing the following files:

  • document.json
  • splat_0.ply
  • splat_1.ply
  • ...
  • splat_n.ply

document.json

Contains all editor state apart from the individual splats. This includes:

  • version, number starting at 0 and increasing with schema changes
  • view settings
  • camera settings
  • camera poses
  • per-splat settings.

splat_n.ply

Each PLY present in the document is similar to its exported counterpart with the following differences:

  • color tinting is not applied, but rather color tint settings are stored in document.json
  • the splat's world transform is not applied, but rather stored in document.json

Example

Here is a sample document.

example.super.zip

The file has been renamed to a .zip extension to allow attachment here.

Notes

  • we write the document using a custom zip writer implementation in order to stream the file out and lower memory requirements
  • loading the document is done with JSZip, but this likely results in memory overhead and will need to be addressed in future
  • even though SuperSplat UI currently supports a single set of camera poses, the document supports multiple (since we are likely to add support for multiple in the near future).
  • it would be prudent to document the schema in document.json. This will be discussed and done in a followup PR.
  • we currently output the document with .super extension because I like it, but this might change based on the success or not of bribery @willeastcott

@slimbuck slimbuck added the enhancement New feature label Jan 28, 2025
@slimbuck slimbuck requested a review from a team January 28, 2025 12:26
@slimbuck slimbuck self-assigned this Jan 28, 2025
@willeastcott
Copy link
Contributor

willeastcott commented Jan 28, 2025

The document is a simple uncompressed zip archive

Any reason not to ZIP it? Otherwise, these things are gonna eat up quite a lot of disk space, right?

@willeastcott
Copy link
Contributor

willeastcott commented Jan 28, 2025

Can the menu be:

New
Open
---
Save
Save As
---
Import
Export
---
Save Screenshot

I'm not 100% sure where to put Save Screenshot actually. But grouping Import and Export would be cool (the above is more similar to Blender).

@slimbuck
Copy link
Member Author

Any reason not to ZIP it? Otherwise, these things are gonna eat up quite a lot of disk space, right?

Yes. JSZip and the other libraries I looked at require a blob/array of all data before writing out the zip file. This would double the memory requirement during save. We're streaming the data out instead.

src/doc.ts Outdated Show resolved Hide resolved
@willeastcott
Copy link
Contributor

I would recommend renaming the 'Scene' menu to 'File'.

@slimbuck
Copy link
Member Author

I would recommend renaming the 'Scene' menu to 'File'.

It's a big change, will do in a followup PR.

@slimbuck slimbuck merged commit e2786ba into playcanvas:main Jan 28, 2025
2 checks passed
@slimbuck slimbuck deleted the doc-dev branch January 28, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SuperSplat file format
2 participants