Support multiple glTF UV sets#2938
Open
hybridherbst wants to merge 1 commit into
Open
Conversation
jstone-lucasfilm
left a comment
Member
There was a problem hiding this comment.
Thanks for this contribution, @hybridherbst! This looks close to the mark, and I had just two recommendations for improvements.
|
|
||
| unsigned int stride = 0; | ||
| MeshStreamPtr stream = mesh->getStream(input.first); | ||
| // Fall back to the first texcoord stream when the mesh has fewer UV sets than the material. |
Member
There was a problem hiding this comment.
These two updates to GLSL and MSL look great, but I believe we need a corresponding update for Slang as well, in SlangProgram.cpp.
| { | ||
| throw ExceptionRenderError("Geometry buffer could not be retrieved for binding: " + input.first + ". Index: " + std::to_string(index)); | ||
| // Fall back to the first texcoord stream when the mesh has fewer UV sets than the material. | ||
| if (input.first.find("i_texcoord_") != std::string::npos) |
Member
There was a problem hiding this comment.
Perhaps we should use the existing constant HW::IN_TEXCOORD, rather than adding this hardcoded string? The same approach could be used in MSL and Slang as well.
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.
This PR adds support for multiple UV sets throughout the apps in this repository. So MaterialXView, MaterialXGraphEditor and so on can now work with materials and objects that have multiple UV sets.