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

Apply vertex attribute fixing to the LOD system for rigged meshes. #90180

Closed
wants to merge 1 commit into from

Conversation

fire
Copy link
Member

@fire fire commented Apr 3, 2024

Fixes: #84479

Here's a sample video with me toggling the mesh lod settings in the background.

Godot Engine autolod patch rig lod success 02

https://youtu.be/JodufVyd3Ow and https://youtu.be/BMvh1J9ril0

  • Fix crash on same fbx repository.

@AThousandShips AThousandShips added this to the 4.3 milestone Apr 3, 2024
@AThousandShips AThousandShips requested a review from a team April 3, 2024 18:10
@fire fire force-pushed the lock-primary-base-influence branch 24 times, most recently from 07cf5e4 to 3e57b0d Compare April 4, 2024 01:30
Comment on lines 85 to 88
struct MergedAttribute {
Vector3 normal;
Vector<int> primary_bone_influence;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not have a Vector<int> for every vertex. it is inefficient, especially given that there is at most a small constant number of influences per vertex

I think it should be possible with one influence and one weight, maybe two influences at most but I'd like to see a counter-example.
Remember that mesh simplify will try to avoid merging vertices with different values here:

Even if the vertex contains a lot more influences, the one or two most dominant influences should be enough to ensure the vertices are considered different.

Copy link
Member Author

Choose a reason for hiding this comment

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

The linked issue ‘s glb fails to decimate correctly if we limit to one or two influences.

Copy link
Member Author

Choose a reason for hiding this comment

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

test.glb.zip

Limited to 1 influence

Screen.Recording.2024-04-04.at.8.34.21.AM.mov

Limited to 8 influences

Screen.Recording.2024-04-04.at.8.35.53.AM.mov

@fire fire force-pushed the lock-primary-base-influence branch 10 times, most recently from b2fe1c1 to 3f677f0 Compare April 14, 2024 15:36
@fire fire force-pushed the lock-primary-base-influence branch 7 times, most recently from 9d7b2e8 to 870f4f5 Compare April 25, 2024 13:19
@fire fire force-pushed the lock-primary-base-influence branch 2 times, most recently from 1cd0988 to 220751e Compare May 31, 2024 16:13
@fire fire force-pushed the lock-primary-base-influence branch 4 times, most recently from 220751e to ddac36a Compare June 6, 2024 04:43
Adjust attribute weights and array sizes for LOD generation.

Increase maximum attributes to 32 in rescaleAttributes function
@fire fire force-pushed the lock-primary-base-influence branch from ddac36a to c69d8e1 Compare June 6, 2024 04:52
@fire fire closed this Jun 19, 2024
@fire fire deleted the lock-primary-base-influence branch June 19, 2024 14:54
@AThousandShips AThousandShips removed this from the 4.3 milestone Jun 19, 2024
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.

Potential skinning issue with glb files
3 participants