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

Improvements to glTF scatter export #95

Merged
merged 11 commits into from
Dec 16, 2024

Conversation

Carifio24
Copy link
Member

This PR makes some improvements to our glTF scatter export. As glTF is probably our most important export format (it's the most widely supported, including what's supported by CoSpaces), it makes sense to try and optimize our glTF export as much as possible. This PR makes a few improvements, some to overall glTF export and some for scatter exports in particular:

  • glTF allows exporting indices as short values - that is, 2-byte integers rather than 4-byte. If the maximum index in any of the triangles in a given mesh is less than 2^16 = 65,536, we can export the indices with 2 bytes per value and reduce the output filesize. This PR updates our glTF utility method to allow using short integers, and uses this when appropriate in our scatter export.
  • There are a few places in our glTF colormapped scatter exports where currently we're making redundant materials. This PR fixes that, which will help with the export filesize.
  • This PR updates our compression to use gltf-transform rather than gltf-pipeline and gltfpack. This package includes both Draco and Meshoptimizer compression, as well as some other stuff as well.
  • Currently, our glTF scatter exports use one mesh per point. The advantage of this is that since each mesh has the same triangulation, we only need to put in the indices for one mesh and then we can reuse the same buffer view and accessor. This helps to save space, but can be less performant since it requires more draw calls in the client. This PR allows setting a points_per_mesh parameter to the layer export method, which allows us to determine whether we want to optimize for filesize or performance. I'm pretty sure that combining meshes together is what some of the optimization extensions do, but it's also nice to offer this for users who need their files to be displayed in a context that doesn't support glTF extensions.
    • Currently there's no option to adjust this in the UI - I'll add this in another PR soon.

@Carifio24 Carifio24 added glTF Related to export of glTF/glB files scatter labels Dec 16, 2024
@Carifio24 Carifio24 merged commit 8f8ec1c into glue-viz:master Dec 16, 2024
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
glTF Related to export of glTF/glB files scatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant