Skip to content

[Ogre2] Destroying material is expensive and does not remove all textures #1167

@iche033

Description

@iche033

Environment

  • OS Version: 24.04
  • Source or binary build?
    source build, gz-rendering10

Description

  • Expected behavior: Destroying an Ogre2Material should be fast and it should clean up all unused textures created by the material, including diffuse, normal, roughness, metalness maps, lightmap, etc
  • Actual behavior:
    • The Destroy() function can be quite expensive when there are many textures in the scene. The expensive part is that it loops through all materials and checks to make sure they are not in use before removing them.
    • In addition, it only checks and cleans up the diffuse texture (this->textureName) and does not check for other texture maps like normal maps, etc. So other maps are not cleaned up properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingogre2.x

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions