Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Nov 17, 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.


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

#3085)

Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 40dbdeb)
@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Nov 17, 2025
@iche033 iche033 merged commit 0ebf32e into gz-sim9 Nov 17, 2025
15 of 16 checks passed
@iche033 iche033 deleted the mergify/bp/gz-sim9/pr-3085 branch November 17, 2025 23:26
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏛️ ionic Gazebo Ionic

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants