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

Use node-based method for glTF export #93

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Carifio24
Copy link
Member

This PR provides an implementation for a different way to do glTF scatter and voxel exports. Currently we create a new mesh for each scatter "sphere" or voxel. This approach here is to use the fact that these meshes all have the same fundamental shape to instead have each scatter point or voxel be its own node, each of which reuses the same mesh, just translated and maybe scaled (in the case of linearly-sized scatter layers). This has some pros and cons:

Pros

  • This makes our files significantly smaller, and makes our filesize almost completely insensitive to the resolution that we choose for scatter spheres. This is because each point now only needs 3 or 6 values (3 translation + maybe 3 scaling), rather than 3 * N(resolution), where N(resolution) ~ resolution^2.

Neutral

  • The fact that we're only using one mesh makes Draco and Meshoptimizer compression not very effective (and in some cases they even make the files larger). However, the size savings here mitigate this issues. Note that these compression options would still be useful, as this node-based scheme isn't effective for isosurfaces

Cons

  • Performance. In my experimentation, these node-based files show noticeably worse performance inside of rendering clients when compared with the mesh-based approach that we currently use.

Overall, I'm marking this as a draft because I'm not sure yet whether it makes sense to use this or not. Maybe we could offer users an option ("Optimize for filesize" vs. "Optimize for performance"?)

@Carifio24 Carifio24 added glTF Related to export of glTF/glB files voxel scatter labels Dec 2, 2024
@Carifio24
Copy link
Member Author

After trying on a phone, I can confirm that the performance is significantly worse compared to our current multi-mesh based implementation. This would've been nice for the filesize benefits, but oh well.

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 voxel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant