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

Prevent loading lightmaps if mesh is a glb file that has an occlusion-metallic-roughness texture #538

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Oct 4, 2023

🦟 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 the b channel of this texture. I suspect that the right thing to do is to extract the r 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

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

@iche033 iche033 requested a review from marcoag as a code owner October 4, 2023 23:09
@github-actions github-actions bot added 🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic labels Oct 4, 2023
Signed-off-by: Ian Chen <[email protected]>
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #538 (fcaf0d2) into gz-common5 (0e866d8) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head fcaf0d2 differs from pull request most recent head e02a4c7. Consider uploading reports for the commit e02a4c7 to get more accurate results

@@              Coverage Diff               @@
##           gz-common5     #538      +/-   ##
==============================================
- Coverage       83.65%   83.64%   -0.01%     
==============================================
  Files              90       90              
  Lines           10249    10243       -6     
==============================================
- Hits             8574     8568       -6     
  Misses           1675     1675              
Files Coverage Δ
graphics/src/AssimpLoader.cc 88.97% <ø> (-0.25%) ⬇️

@iche033
Copy link
Contributor Author

iche033 commented Oct 5, 2023

the homebrew warning should be fixed in #529

@iche033 iche033 merged commit 7838ced into gz-common5 Oct 5, 2023
10 checks passed
@iche033 iche033 deleted the gltf_lightmap branch October 5, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants