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

Translucency Sorting With Quad Splitting #2993

Draft
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

douira
Copy link
Collaborator

@douira douira commented Jan 24, 2025

Fixes translucency sorting for geometry that is intersecting or otherwise unsortable by splitting quads in the partition-tree. Also fixes an old mistake in the sort triggering code in the form of a wrong equals implementation on AlignableNormal.

A 1.21.1 version of this patch is available at https://github.com/douira/sodium/tree/1.21.1/translucent-quad-splitting

Fixes #2943

  • Configuration option
  • Remove dev and debug info
  • Limit to how much geometry it can add (factor of 2x or 3x probably enough)
  • Compare meshing time with/without quad splitting enabled

overview
split

@jellysquid3
Copy link
Member

Also fixes an old mistake in the sort triggering code in the form of a wrong equals implementation on AlignableNormal.

Would it make sense to pull this patch out of this pull request so we can backport it? I'm not sure what it is breaking exactly.

@douira
Copy link
Collaborator Author

douira commented Jan 24, 2025

It does break things that require sort triggering on unaligned normals but it's unlikely anyone would notice unless the geometry is particularly weird. It only becomes more noticeable with this patch because previously the partition tree wouldn't generate unaligned partition (i.e. triggering) planes, and unaligned trigger planes were only generated by the super rarely used dynamic topo sorting mode.

I could split it out if you'd merge such a fix before 0.7, which is when I'd expect this to be ready for as a whole.

@muzikbike
Copy link
Contributor

Does this fix #2943? May be worth marking as such if so.

@douira douira force-pushed the translucent-quad-splitting branch from ec5a877 to 0939e4f Compare January 26, 2025 22:25
… later would not be added to the triggering system even though they should have been, this was caused by a buggy equals implementation in AlignableNormal.

remove AlignableNormal and replace with a Vector3f & int pair in NormalList and NormalPlanes, associated refactors to remove custom hashing strategy usage again,
…o avoid getting into an inconsistent when later calculations yield different results because precision was lost along the way
@douira douira force-pushed the translucent-quad-splitting branch from a6e0d9e to d1409cb Compare January 28, 2025 02:32
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.

Translucency sorting for intersecting translucent planes
3 participants