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

Extras hint for mesh consolidation #1731

Open
petrbroz opened this issue Jan 2, 2020 · 2 comments
Open

Extras hint for mesh consolidation #1731

petrbroz opened this issue Jan 2, 2020 · 2 comments

Comments

@petrbroz
Copy link

petrbroz commented Jan 2, 2020

In petrbroz/svf-utils#9 we're discussing the best way to provide hints for viewers and tools like https://github.com/zeux/meshoptimizer as to which scene nodes could be consolidated to improve runtime performance, and we'd like to get some feedback from the community.

We're thinking about adding a new field in the extras, something like mergeGroup. Another approach might be to provide some sort of a consolidable flag/hint on a node in the scene hierarchy that would suggest that it's the smallest "logical" entity, and that all its descendants can be consolidated. Has anyone else considered a similar type of hint?

@donmccurdy
Copy link
Contributor

Could you say more about the motivation and use cases? If a tool knows which nodes could be merged, is it choosing not to merge them for reasons of technical complexity? Or because some downstream tools may support or benefit from the full version?

At least for three.js, I would not expect to do this merging on the fly. Unless, perhaps, the flag/hint indicated not just a logical entity, but also that it was technically feasible to merge the nodes. For example, we can't merge meshes with different materials, different draw modes, or different attributes. An offline optimizing tool like meshoptimizer might have more options here, of course, like texture atlases.

@petrbroz
Copy link
Author

petrbroz commented Jan 3, 2020

The idea is to suggest a good balance between performance and interactivity to viewers, loaders and post-proc tools. An "aggressive" consolidation of all meshes with the same material would provide great performance improvements but the downstream tools could lose important information embedded in the scene hierarchy.

One example use case is being discussed in #1699 - we're generating very complex models (infrastructure, architecture, engineering, construction, etc.) that definitely need to be optimized but we would prefer to keep individual "logical objects" separate because:

  • their nodes could contain important downstream information such as links to external, app-specific data relevant to the logical object
  • they could still be interacted with (selected, highlighted, transformed, etc.)

We could potentially consolidate the meshes directly in our tool but I'm thinking that adding some kind of "consolidation hint" into the manifest might be a better way to interop with other tools in the ecosystem.

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

2 participants