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

Fix loading lightmaps from gltf / glb meshes #630

Merged
merged 3 commits into from
Sep 5, 2024
Merged

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Aug 30, 2024

🦟 Bug fix

Summary

Fix loading gltf / glb mesh files with lightmaps. Needed by the Ionic demo world.

Currently the lightmap is ignored if there's a combined roughness + metalness texture. This PR fixes the problem by loading the lightmap (ambient occlusion data) from the roughness + metalness texture.

Tested with a few gltf sample models (water bottle, barramundi fish, damaged helmet)

Here are screenshots of the BarramundiFish before (left) and after (right) the change. I removed the albedo map to better visualize the effect of the lightmap:

barramundi_no_lightmap barramundi_lightmap

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.

Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 requested a review from marcoag as a code owner August 30, 2024 00:47
@iche033 iche033 changed the title Fix gltf lightmap Fix loading lightmaps from gltf meshes Aug 30, 2024
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

just some nits, otherwise LGTM

graphics/src/AssimpLoader.cc Show resolved Hide resolved
graphics/src/AssimpLoader.cc Show resolved Hide resolved
Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 changed the title Fix loading lightmaps from gltf meshes Fix loading lightmaps from gltf / glb meshes Sep 5, 2024
@iche033
Copy link
Contributor Author

iche033 commented Sep 5, 2024

Some tests in UNIT_AssimpLoader_TEST on hombrew are failing. I noticed that they are failing in main as well and could be due to a new AssimpLoader homebrew bottle. I ticketed an issue for it: #633

@ahcorde ahcorde enabled auto-merge (squash) September 5, 2024 20:31
@iche033
Copy link
Contributor Author

iche033 commented Sep 5, 2024

Fixed homebrew CI in #634

@ahcorde ahcorde merged commit bbb3183 into gz-common6 Sep 5, 2024
11 checks passed
@ahcorde ahcorde deleted the fix_gltf_lightmap branch September 5, 2024 22:30
Crola1702 pushed a commit that referenced this pull request Sep 16, 2024
@Crola1702 Crola1702 mentioned this pull request Sep 16, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants