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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

What is better? 1 object and many materials or 1 material and many objects?

Discussion in 'Editor & General Support' started by danielrune13, Apr 9, 2021.

  1. danielrune13

    danielrune13

    Joined:
    Nov 2, 2018
    Posts:
    14
    Hey guys! What would be better in terms of performance? 1 object and 30 different materials to choose or 30 objects (with the same exact geometry), all with the same material (which would be a texture atlas)?
    Suppose the objects have around 250 polygons each.
    I'm making a 3d asset pack to put for sale at Unity Asset Store, but I want it to be good for mobile, so I want to understand this.
    In this image I have the same object with different material versions. I could either send only 1 object to Unity Editor and create 13 different materials for him there or I could send all these objects and make a texture atlas for all of them.
    Now imagine this on a bigger scale, more material options and more objects (walls, grounds, chairs, etc)

    aa.png
     
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    The most efficient way is to use a base texture and color it with a shader. (for batching if that is needed material property blocks can be used.
    But if you need different textures per object, it depends what you optimize for.
    If you know that all or a lot of objects in a set are used together it makes sense to use a atlas.
    If you probably only gone use one color of door for example over and over, it would be wasteful to load the texture memory for 29 different variants you don't use.

    For a pack of objects for other people to use i would probably separate the textures per variant or if possible use the shader for coloring.
     
  3. danielrune13

    danielrune13

    Joined:
    Nov 2, 2018
    Posts:
    14
    I don't know, this is a pack for interior building. It has walls, grounds, doors, windows, etc. Some objects have more then 1 color material but then have different combinations. Like in the image, each door has 2 color materials: the main and the door handle. I want some versions with specific combinations (say, a brown door handle and a white main color). What do you think would be the best approach?