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

Adds higher precision spatial sorting #651

Closed
wants to merge 1 commit into from

Conversation

pm4rtx
Copy link

@pm4rtx pm4rtx commented Jan 25, 2024

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.

@zeux
Copy link
Owner

zeux commented Jan 25, 2024

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.

@zeux
Copy link
Owner

zeux commented Aug 27, 2024

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.

@zeux zeux closed this Aug 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants