-
Notifications
You must be signed in to change notification settings - Fork 511
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
Function to separate disconnected pieces of geometry #570
Comments
Why is connectivity important? For example, given a tree model with separate leaves, this function would likely have to report a very large number of connected clusters, each being a single leaf, as the leaves would not be connected to each other and the trunk would have a separate material. Normally mesh shading pipelines cull per object and then per cluster (meshlet). The second level of granularity is finer than any sort of cluster grouping. If a higher level cluster grouping is desired, I'm wondering if it would be sufficient to simply treat each consecutive group of meshlets of a desired size (eg every 64 meshlets) output by Overall I don't fully understand the ask here. |
For context, I'm investigating an alternative approach where sections of a scene would be aggregated into a single large model (say, a city block), which would then be drawn by using mesh shading as essentially a hardware-accelerated 4-level HLOD:
In such an arrangement, connected clusters would be analogous to what would normally be treated as objects during level design. This has the benefit that it can be retrofitted to a traditional pipeline more easily and is less cumbersome to set up than traditional HLODs. It would also make such scenes easier to exchange between DCC applications, as the object hierarchy would be less cluttered.
Connected clusters are the finest granularity at which LOD swaps can be guaranteed to be crack-free. While there are technically ways to reach even finer granularity using something like Nanite's DAG of meshlets, this would require far more engineering resources and be much harder to generalize across users of meshoptimizer.
Thanks, I hadn't considered this - perhaps it would be prudent to provide an option to set a lower limit to the number of triangles/vertices in a cluster, so that multiple tiny connected clusters that can fit into a single meshlet can still be drawn together. |
Ah, I see. So the goal is to increase the granularity of LOD from the single mesh to a smaller unit without having to synchronize LOD transitions between pieces. That makes sense. |
The need for this has gone down significantly on my side, but thank you for the consideration nonetheless! |
This would be useful for mesh shading pipelines, as it would allow each piece to be assigned to its own task shader, and allow finer granularity for traditionally per-object operations such as culling and LODs. This is much simpler than Nanite's approach to fine-grained crack-free LOD transitions, which requires headache-inducing algorithms in order to build and traverse a DAG of meshlets.
Engines would presumably generate LODs for every piece after they are separated, and then split every piece's LODs into meshlets.
See the following comment for more details on task shaders and pieces of geometry: godotengine/godot-proposals#6822 (comment)
To maximize compatibility with non-mesh shading pipelines, it should probably sort a supplied index buffer (remap table?) and return an array of
{index_offset; index_count}
pairs to represent distinct pieces, so that pieces (and their LODs) can act as an optional structure that references standard index buffers.The text was updated successfully, but these errors were encountered: