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

[TS] Delete VertexRange, use isTranslucent, fix partition tree sorting on geometry with negative dot products #2655

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

douira
Copy link
Collaborator

@douira douira commented Aug 11, 2024

  • Delete VertexRange as since the introduction of the translucency sorting system its first offset field wasn't getting used anymore. It can simply be calculated on the fly as a prefix sum. Currently missing vertex ranges are replicated as -1 lengths which are distinct from a length of zero. I don't know if this is actually necessary or if we can just use a zero length as the default.
  • Use the isTranslucent method on terrain render passes and materials instead of checking equality
  • Fix a crash related to translucency sorting that happened during the initial sort in the meshing task. This bug was triggered when a certain model (I don't know which one) on MCC Island was being sorted. Importantly, it extended outside of the chunk so that the dot products of its quads were negative with the axes. The partition tree building algorithm incorrectly handled negative dot products and produced a partition tree with duplicate nodes, which in turn led to a buffer overflow since too many quad indexes were being written.
  • Fixed floatToComparableInt to actually be correct, it doesn't seem to have been correct previously.

… objects to just deal with vertex counts instead of the mesh object
@IMS212
Copy link
Member

IMS212 commented Aug 12, 2024

Would it make sense to remove the TS option from settings now, rather than later?

@douira
Copy link
Collaborator Author

douira commented Aug 12, 2024

I don't know if a setting is necessary. If we don't have to have it, we should remove it before release. Maybe keeping it as a setting in the config file only is enough. However, for debugging TS issues it's helpful if it can be disabled as a comparison. Then again, we can also send them a build with the setting and/or it disabled by default.

@jellysquid3
Copy link
Member

I think we'll get rid of it (or put it behind a developer option) before release. But it's not relevant for this pull request.

@jellysquid3 jellysquid3 merged commit 7b25a31 into CaffeineMC:dev Aug 12, 2024
1 check passed
@douira douira deleted the cleanup-vertex-ranges branch September 14, 2024 19:23
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.

3 participants