Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 10, 2025

🎉 New feature

Related to gazebosim/jetty_demo#3

Summary

Adds a new Image::ChannelData function to help extract a single channel (r, g, b, or a) from an RGB[A] image.

Thanks for profiling data from @azeey, it was found when loading the Jetty demo world a big chunk of time is spend on splitting the metallic and roughness maps of glb meshes. The main cause of slow down is found to be the Image::Pixel function as the AssimpLoader iterates through every pixel in the image. With the new Image::ChannelData function, the AssimpLoader now has a faster and more efficient way of retrieving different channels of the input image.

Note that the perf issue with Image::Pixel function was also noticed in #699 (comment). Some changes were made to speed it up but seems like it's still not efficient. We'll need to revisit this later on.

For the Jetty demo world, the speed up for splitting the channels of an image was found to be >10x. See example timings (seconds):

  • Distribution_Warehouse_Ceiling.001_MetallicRoughness
    • before: 1.22474
    • after: 0.113241
  • Distribution_Warehouse_Container.003_MetallicRoughness
    • before: 0.301955
    • after: 0.0263694
  • Distribution_Warehouse_Column.001_MetallicRoughness
    • before: 0.304193
    • after: 0.025477
  • Distribution_Warehouse_Door.001_MetallicRoughness
    • before: 0.323877
    • after: 0.0263867

The load time for the demo world reduced from 42s (with gazebosim/gz-sim#3070) to 30s on my machine.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Remove this if GenAI was not used.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.


This is an automatic backport of pull request #706 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from marcoag as a code owner September 10, 2025 22:48
@mergify mergify bot added the conflicts label Sep 10, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Sep 10, 2025

Cherry-pick of e481234 has failed:

On branch mergify/bp/gz-common5/pr-706
Your branch is up to date with 'origin/gz-common5'.

You are currently cherry-picking commit e481234.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   graphics/include/gz/common/Image.hh
	modified:   graphics/src/Image.cc
	modified:   graphics/src/Image_TEST.cc

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   graphics/src/AssimpLoader.cc

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

…706)

Signed-off-by: Ian Chen <[email protected]>
(cherry picked from commit e481234)
Signed-off-by: Ian Chen <[email protected]>

# Conflicts:
#	graphics/src/AssimpLoader.cc
@iche033 iche033 force-pushed the mergify/bp/gz-common5/pr-706 branch from 4f3fee3 to c6c88ff Compare September 10, 2025 23:59
@iche033 iche033 removed the conflicts label Sep 11, 2025
@iche033 iche033 merged commit b2dd2e6 into gz-common5 Sep 11, 2025
10 of 11 checks passed
@iche033 iche033 deleted the mergify/bp/gz-common5/pr-706 branch September 11, 2025 00:21
@github-project-automation github-project-automation bot moved this from Inbox to Done in Core development Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎵 harmonic Gazebo Harmonic

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant