Prevent loading lightmaps if mesh is a glb file that has an occlusion-metallic-roughness texture #538
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.
🦟 Bug fix
Summary
When loading this water bottle glb file, I manually saved the lightmap texture file (loaded by assimp) to examine what it looks like. It turns out the lightmap texture is just a copy of the occlusion-metallic-roughness texture, which is not correct. There are issues reported upstream (see inline comments in code).
Currently if an occlusion-metallic-roughness texture exists, we extract the roughness texture map from the
g
channel and the metalness map is in theb
channel of this texture. I suspect that the right thing to do is to extract ther
channel as a separate occlusion texture and use that as the lightmap (not quite the same but occlusion maps are not yet supported in gz-rendering). This needs to be investigated. For now, this PR prevents setting incorrect lightmap textures for glb meshes.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.