Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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,155
    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:
    27
    Looks like a great catch. We'll try to address this soon. Thanks for the report!