X Tutup
Skip to content

Use regularization flag for LODs of deformable objects to improve appearance post deformation#109992

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
zeux:simplify-regularize
Sep 23, 2025
Merged

Use regularization flag for LODs of deformable objects to improve appearance post deformation#109992
Repiteo merged 1 commit intogodotengine:masterfrom
zeux:simplify-regularize

Conversation

@zeux
Copy link
Contributor

@zeux zeux commented Aug 26, 2025

Closes #84479
Closes #71141

When generating LODs for meshes that use skinning or blend shapes, we now use the new regularization option (available as of meshoptimizer 0.25). This results in the simplifier taking the distance along the original surface into account when computing simplification error, which biases the results to have a more uniform tessellation, accounting for deformation that is unknown at import time. This fixes two instances of severe LOD degradation (above) after a re-import; it also helps more regular character meshes in certain cases, for example here's a before-after on a mesh with a cape that was simplified too much previously (LOD selection exaggerated via project settings, ~same number of triangles before/after):

before after
image image
image image

@zeux zeux requested review from a team as code owners August 26, 2025 17:48
@Calinou Calinou added this to the 4.6 milestone Aug 26, 2025
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Will want to try out the test cases to visually see the improvements. I like the neat trick you did.

Edited:

taking the distance along the original surface into account

@fire
Copy link
Member

fire commented Aug 26, 2025

Significant improvement was seen at lod_bias 0.04

GODOT-pull-request-109992.mp4
GODOT-stable-4.4.mp4

SkinningIssue-GODOT-pr-109992.zip

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me. Remember to squash the last two commits so this can be merged 🙂

@zeux zeux force-pushed the simplify-regularize branch from 9a8fa9d to e5b2798 Compare September 10, 2025 22:33
@zeux
Copy link
Contributor Author

zeux commented Sep 11, 2025

Yup, squashed the last two commits here and rebased the dependent PR chain.

@zeux zeux force-pushed the simplify-regularize branch from e5b2798 to 5662819 Compare September 19, 2025 05:58
This significantly improves LOD quality for skinned objects, especially
if the skinned object geometry is very simple (e.g. planar or
cylindrical) in bind pose.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
@zeux zeux force-pushed the simplify-regularize branch from 5662819 to 92596e3 Compare September 19, 2025 15:46
@Repiteo Repiteo merged commit 96d9303 into godotengine:master Sep 23, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Sep 23, 2025

Thanks!

@zeux zeux deleted the simplify-regularize branch September 23, 2025 21:40
@fire
Copy link
Member

fire commented Sep 24, 2025

Would it be possible to cherry pick for 4.5?

@akien-mga
Copy link
Member

akien-mga commented Jan 16, 2026

Cherry-picked for 4.5.2.

Edit: Dropped cherry-pick, it depends on #109990 which is a feature PR.

@akien-mga akien-mga removed the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skinning issue with glb files Generate Lods option does not import models correctly

7 participants

X Tutup