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).

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Sep 10, 2025
@iche033 iche033 merged commit 2e575b8 into gz-common6 Sep 10, 2025
15 of 16 checks passed
@iche033 iche033 deleted the mergify/bp/gz-common6/pr-706 branch September 10, 2025 23:57
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Sep 10, 2025
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.

1 participant