Skip to content

Support multiple glTF UV sets#2938

Open
hybridherbst wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
needle-tools:feature/multiple-uv-sets
Open

Support multiple glTF UV sets#2938
hybridherbst wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
needle-tools:feature/multiple-uv-sets

Conversation

@hybridherbst

Copy link
Copy Markdown
Contributor

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.

@jstone-lucasfilm jstone-lucasfilm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

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.

2 participants