Rewrite LOD simplification with Blender-style min-heap algorithm#317
Open
Szy-Cathay wants to merge 1 commit intodonkeyProgramming:masterfrom
Open
Rewrite LOD simplification with Blender-style min-heap algorithm#317Szy-Cathay wants to merge 1 commit intodonkeyProgramming:masterfrom
Szy-Cathay wants to merge 1 commit intodonkeyProgramming:masterfrom
Conversation
Replace the Forstmann threshold-based iterative approach with a single-pass min-heap edge collapse algorithm inspired by Blender's bmesh_decimate_collapse.cc. Key changes in MeshDecimator: - New EdgeEntry struct with version-based stale detection (replaces floating-point cost comparison that was unreliable) - New methods: ComputeEdgeCost, PushEdgeCost, BuildEdgeCosts, UpdateNeighborCosts, IsDegenerateTopology, InitBordersAndSmartLink, InitQuadricsAndBoundaryConstraints - Rewritten DecimateMesh/DecimateMeshLossless for single-pass min-heap - Removed: CollapseCandidate, RemoveVertexPass, UpdateMesh - Added scalar multiply operator to SymmetricMatrix - Removed seamMismatch/foldoverMismatch hard blocks for more uniform simplification Bug fixes: - Fix maxVertexCount mapping to int.MaxValue causing early loop exit (only 2 triangles removed per LOD level) - Fix DecimatorMeshOptimizer using vertex count instead of triangle count for target calculation (causing over-aggressive simplification) Blender improvements retained: - Area-weighted flip detection (0.01 threshold) - Boundary constraint planes (100x weight) - Topology fallback for flat regions - Normal interpolation by edge-parametric factor - Degenerate topology check (duplicate face prevention)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the Forstmann threshold-based iterative approach with a single-pass min-heap edge collapse algorithm inspired by Blender's bmesh_decimate_collapse.cc.
Key changes in MeshDecimator:
Bug fixes:
Blender improvements retained: