Skip to content

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Sep 10, 2025

🦟 Bug fix

Related issue: gazebosim/jetty_demo#3
Requires gazebosim/gz-rendering#1168

Summary

When updating the cast shadows property of a visual, we set the material with the cast shadow value to all the submeshes in the visual. However, the SetMaterial call by default clones the input material before setting it to the submesh. The submesh's original material will also be destroyed during this process. The problem is that the material destruction process was found to be expensive and does not cleanup textures properly, see gazebosim/gz-rendering#1167. This PR updates the SetMaterial call to pass false in the second arg so the material is not cloned when being set, which prevents the original material from being destroyed.

When running the Jetty demo world, the load time reduced from 30s to 24s on my machine (tested with with #3070 and gazebosim/gz-common#706)

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

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Sep 10, 2025
@iche033
Copy link
Contributor Author

iche033 commented Sep 10, 2025

we'll need another gz-rendering10 pre-release after gazebosim/gz-rendering#1168 is merged to get the CI green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪵 jetty Gazebo Jetty needs upstream release Blocked by a release of an upstream library
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

3 participants