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

Convert .ply to .splat #28

Closed
imbahhc opened this issue Oct 27, 2023 · 5 comments
Closed

Convert .ply to .splat #28

imbahhc opened this issue Oct 27, 2023 · 5 comments

Comments

@imbahhc
Copy link

imbahhc commented Oct 27, 2023

Dear author,
I'm a new user for java. Could you please tell me where to put the code you provide to convert .ply file to .splat file? Thank you.
Best regards,
hhc

@mkkellogg
Copy link
Owner

mkkellogg commented Oct 27, 2023

That's a very good question, right now I just run the code from inside a web page. I should really make a node script to do the conversion -- I'll work on that :) For now, just create a web page that looks like this:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script type="importmap">
      {
          "imports": {
              "three": "./lib/three.module.js",
              "gaussian-splats-3d": "./lib/gaussian-splat-3d.module.js"
          }
      }
    </script>
  </head>
  <body>
    <script type="module">
      import * as GaussianSplats3D from 'gaussian-splats-3d';
      const compressionLevel = 1;
      const splatAlphaRemovalThreshold = 10;
      const plyLoader = new GaussianSplats3D.PlyLoader();
      plyLoader.loadFromFile('<path to .ply file>', compressionLevel, splatAlphaRemovalThreshold)
      .then((splatBuffer) => {
          new GaussianSplats3D.SplatLoader(splatBuffer).saveToFile('converted_file.splat');
      });
    </script>
  </body>
</html>

If you put the above web page in the build/demo folder it should load correctly.

@mkkellogg
Copy link
Owner

Not sure if you're still interested, but the latest version has a UI for converting .ply files to .splat at http://localhost:8080/index.html

@softyoda
Copy link

softyoda commented Nov 1, 2023

Hi quick question relating to .splat format.

Are you still using same .spat format than other integration (aframe/antimatter)?

In your readme you say "currently only compatible with this viewer", does that mean your .splat format is more optimized, and you integrate ways to reduce the height of a scene using Aras optimization such as chunking / texture / clustering / spherical-harmonics lower order precision to have less bit per splat ?

@mkkellogg
Copy link
Owner

Yes I have implemented some of my own optimizations to reduce the size of the .splat file. Currently I have implemented chunking to a small extent as well as the option to store position/scale/rotation values as 16-bit instead of 32-bit. Optimizing the .splat format is still an ongoing project; I know there are still several things I can do. I have read through Aras's blog on reducing file size and I will hopefully get around to implementing more of those ideas soon.

@mkkellogg
Copy link
Owner

Closing for now in favor of the .splat format discussions in: universal format discussion.

FWIW the latest version of this repo supports directly importing the .splat files that the antimatter15 project uses.

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

No branches or pull requests

3 participants