Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug [1.1.0-exp.1] RenderMesh uses wrong materials during baking with submesh sharing.

Discussion in 'Graphics for ECS' started by DreamingImLatios, Oct 11, 2023.

  1. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,349
    Using Entities.Graphics 1.1.0-exp.1 with ENABLE_MESH_RENDERER_SUBMESH_DATA_SHARING defined. There are two GameObjects in the subscene named DualMatBlock, each having a mesh with two submeshes. Both blocks have the same material for the first slot. However, they have different materials for the second slot (red vs blue).

    upload_2023-10-10_22-59-55.png

    When baking these two GameObjects, both objects end up looking identical, when they should look different because one of the materials is different.
    upload_2023-10-10_23-0-16.png

    The reason this happens is that RenderMesh shared component equality only compares the first material slot when submesh sharing is enabled. This should compare all materials.

    IN-57221
     
    Last edited: Oct 11, 2023
  2. VincentBreysse

    VincentBreysse

    Unity Technologies

    Joined:
    May 31, 2021
    Posts:
    28
    Looks like a great catch. We'll try to address this soon. Thanks for the report!