Search Unity

Question Multiple materials on same submesh not working after entity conversion

Discussion in 'Graphics for ECS' started by BenMM, Jan 5, 2023.

  1. BenMM

    BenMM

    Joined:
    Jan 28, 2019
    Posts:
    16
    Hi,
    Iam trying to render two passes on the same submesh. Since URP seems to not allow multipass shaders, i tried applying two materials. This works fine with my simple test case in edit mode in the scene view, but as soon as you enter playmode/after entity conversion it only renders the first material in the renderers material list.

    Is there a way to make this work for entities or are there any other ways i could approach this topic?

    upload_2023-1-5_22-59-59.png

    2 shaders one move vertecies to the right in red coating and the other green to the left.

    In Scene view in edit mode both materials get rendered:
    upload_2023-1-5_22-59-27.png

    After entering into playmode/conversion to entity only the first material in the list is rendered:
    upload_2023-1-5_23-0-29.png



    Any help would be appreciated!

    Regards!
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    639
    Mesh renderer conversion very specifically matches up submeshes to one material. You would need two meshes or one mesh with two submeshes to do something like this with the current state of things.
     
  3. BenMM

    BenMM

    Joined:
    Jan 28, 2019
    Posts:
    16
    Hi,
    thank you for the reply!
    Would you by chance know if there is a way to use a multipass shader with URP?

    Regards