Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

With SRP batcher, should I use multiple materials or multiple meshes?

Discussion in 'General Graphics' started by mikeohc, Aug 23, 2021.

  1. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    174
    So for a smaller example, I'm making a 3D keyboard with each key being interactable (should play a click animation on its own).

    I've seen discussions about using less materials is better, and of course batching meshes together.

    I'm wondering for the keyboard case, would it be better to :
    1) use the same mesh with same UV map for all identical keys and create different materials for EACH key (same shader).
    2) use different meshes for each key with their own UV map, and use one texture that contains all keys.

    Since SRP Batcher claims to allow as many materials as possible, would either way be viable nowadays?
     
  2. Zerio777

    Zerio777

    Joined:
    Jan 12, 2015
    Posts:
    24
    #2, duplicate meshes, multiple mats UV offset.

    I believe one of the primary benefits to SRP is that it can handle many more materials within the project without losing too much performance, whereas batched/static rendering would prefer you keep both meshes and mats low.
     
    mikeohc likes this.
unityunity