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

Point cloud meshlet generation #642

Open
Krixtalx opened this issue Dec 19, 2023 · 2 comments
Open

Point cloud meshlet generation #642

Krixtalx opened this issue Dec 19, 2023 · 2 comments

Comments

@Krixtalx
Copy link

I have seen that the meshlet generation method works with connectivity pretty much all the time. In point cloud models we don't have any connectivity data. Could be possible to use the method with point clouds?

@zeux
Copy link
Owner

zeux commented Dec 22, 2023

Point clouds are a little different in the sense that when building meshlets out of a triangle mesh, you need to take connectivity and vertex reuse into account as well as spatial locality. When working with points, the only optimization criteria is locality.

Right now the only approach that would work out of the box would be to use meshopt_spatialSortRemap, then use meshopt_remapVertexBuffer to reorder the points, and then just split the resulting buffer into fixed size chunks (of the size of the meshlet).

This approach probably won't be as good as using a clusterizer. A dedicated point cloud clusterizer would be fairly easy to add since it's just a bunch of nearest-neighbor quieries using the existing kD tree in clusterizer. Let me know if you'd be interested in this or if spatial sort method would suffice for now.

@Krixtalx
Copy link
Author

Thanks for your response. Right now i'm using the spatial sorting. The problem it has is that as it uses morton codes, it generates some "broken" cluster (Image from Software Rasterization of 2 Billion Points in Real Time paper)
image

I have tried to use the kD tree approach looking for the meshlet size nearest neighbors using nanoflann kD tree, but it takes a bunch of time in comparison with the spatial sort (1,3s vs 80s with a ~40 million points point cloud). I don't know if using the spatial sort and somehow detect what meshlets are broken in order to reconstruct them using the kD tree could be possible.

Anyway, if you find it easy to implement, i think that it would be a nice addition to have a dedicated point cloud clusterizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants