-
Notifications
You must be signed in to change notification settings - Fork 496
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
Adds higher precision spatial sorting #651
Conversation
a0b372c
to
44bf22d
Compare
Any chance you'd be able to share some meshes in question, publicly or privately, as well as the evaluation criteria for the sort order? There's definitely an expectation that the quantization in spatialSortRemap produces the same values for points that are too close. But that previously has been considered fine as it didn't affect the actual order too greatly - as in, if the points are close enough then the order of points doesn't matter. That said, of course if the extents of the mesh are very large then maybe the quantization threshold becomes unacceptably large as well. I don't love the idea of adding another API to solve this, however it might be good to solve the issue inside the function itself by automatically switching to a higher precision version under some condition. Additionally I'm curious if you need the full 60 bits of precision here, or if fewer bits suffice - eg if instead of 6 radix passes we could do 4 or 5, this could be good. |
I'm going to close this because I don't think adding a separate API is the right solution. I have an internal TODO item to look into this further, likely the right solution is some combination of careful increase of internal precision (with performance tests) and switching the implementation to use tiling + sorting instead of just a global sort, and all of this should actually be measured on some scene where it makes a difference. |
Hi @zeux, I apologise for the prolonged radio silence with a reply; this PR went off my radar.
I'm OK with this PR being closed as I understand my use case requiring higher bit quantisation/sorting may be well outside the scope |
Thanks, this use case makes sense. Just to make sure, I assume you are not relying on Morton codes per se when you are post-processing the output of a spatial sort, but you have some threshold of closeness that is smaller than 0.1% of the extents of the model, so the 10-bit sort doesn't suffice as you get suboptimal bounds? To be clear, I think it would be reasonable to improve the behavior of |
Yes, there's no reliance on particular Morton code values; it's just reliance on how large the sub-sequence of identical Morton codes is. For example, let's imagine there's a sub-sequence of Morton codes and for each triangle, there's a search radius R=3, so for the triangle Since
because the cluster of identical Morton codes is too large and there's a desire to make it smaller.
Thank you! I did understand that from your previous reply. I just wanted to emphasize it's not a high-priority request. |
Hi,
I've been working with some meshes where 10 bits of precision was not sufficient, so I added a version of
spatialSortRemap
with higher precision, so perhaps it could be helpful in upstream.