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

Fix left handed indexed meshes with normals #2233

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

cpichard
Copy link
Collaborator

When rendering left handed indexed meshes with normals with husk, the sync function is called twice and the second time the leftHanded variable is not correctly set which ends up having the normal indices incorrectly set.

Issues fixed in this pull request
Fixes #2232

@cpichard cpichard marked this pull request as ready for review February 11, 2025 06:09
bool isLeftHanded = false;
// We have to flip the orientation if it's left handed.
const auto topology = GetMeshTopology(sceneDelegate);
bool isLeftHanded = topology.GetOrientation() == PxOsdOpenSubdivTokens->leftHanded;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit worried of moving the GetMeshTopology outside of the "if (dirtyTopology)" as this function seems to have a cost, and we can be called multiple times in Sync even when there's nothing to change.

I think we should either store a bool member _isLeftHanded in the class, of call GetMeshTopology again inside of "if (dirtyPrimvars)", of create an empty HdMeshTopology and set it only "if (dirtyPrimvars || dirtyTopology)" so that the topology can be used inside of both tests, but the more we can remove from outside of the dirtiness tests, the better

@cpichard cpichard merged commit fd41c44 into Autodesk:master Feb 11, 2025
9 checks passed
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.

Incorrect render of meshes with indexed normals
2 participants