Fix subdivision scheme and normal interpolation on export#196
Open
hybridherbst wants to merge 1 commit intoUnity-Technologies:devfrom
Open
Fix subdivision scheme and normal interpolation on export#196hybridherbst wants to merge 1 commit intoUnity-Technologies:devfrom
hybridherbst wants to merge 1 commit intoUnity-Technologies:devfrom
Conversation
jcowles
suggested changes
Jul 16, 2020
Contributor
jcowles
left a comment
There was a problem hiding this comment.
Thanks!
I think we should move subdiv scheme down to the base schema class, let me know if you want to do this or if you would prefer me to do it.
| // for polygonal meshes, we do not want the default subdivision scheme of "catmull-clark" but instead "none" | ||
| // so that authored normals keep working. | ||
| var usdGeomMesh = new pxr.UsdGeomMesh(usdPrim); | ||
| usdGeomMesh.CreateSubdivisionSchemeAttr().Set(new pxr.TfToken("none")); |
Contributor
There was a problem hiding this comment.
I think we should probably make this part of the schema class, in USD.NET.Unity.
| usdGeomMesh.CreateSubdivisionSchemeAttr().Set(new pxr.TfToken("none")); | ||
|
|
||
| // explicitly set the normal interpolation here – | ||
| // default should be "vertex" anyways but seems some viewers don't respect the default |
Contributor
There was a problem hiding this comment.
Can you note the problematic viewers and versions here, for future reference?
phocodes
approved these changes
May 27, 2021
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.
Set subdivision scheme to "none" and explicity set normal interpolation to "vertex". This fixes #192 but will need additional changes for "USD roundtrip" scenarios where keeping the subdiv scheme is desired. I think that is a problem for later since such a round trip would also require proper support for faceVarying attributes being carried through / reconstructed on export if desired.
Current state of this should potentially be added to the docs to make it more clear what "roundtrip" means and what export currently does.