Search Unity

Multiple textures in a single material

Discussion in 'Editor & General Support' started by DarkLordCookie, Jul 24, 2014.

  1. DarkLordCookie

    DarkLordCookie

    Joined:
    Jul 24, 2014
    Posts:
    1
    Hey guys

    I learnt a new technique from Blender, whereas you use multiple UV maps and texture files, to separately texture an object (In this example, a building)

    As you can see in the image, on the left is what i want the building to look like, and on the bottom right, where the UV maps are displayed, there are several in the mesh (one for the door, one for the windows etc)

    Is there any way to take this data, and multiple textures and put it all into one material in Unity? I've tried this but it doesnt work for some reason :(

    Thank you :)
     

    Attached Files:

  2. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    What you want is a "Texture Atlas" and there are multiple ways of doing this. The easiest is to buy an Asset from the asset store such as Mesh Baker which is easy to use. There is software to do this outside Unity as well. You could write a code to do it, but I wouldn't even know where to begin with that.
     
  3. OllyNicholson

    OllyNicholson

    Unity Technologies

    Joined:
    Jun 17, 2011
    Posts:
    142
    The best practice for this is usually to create a 'texture page' or one texture which already contains all the elements you wish to use for the material(s) most artists use a paint package like photoshop to do this then import the texture and use it in the source package (Blender in this case) to map to different models or parts of the same model from one texture, then when you export from Blender it is only one texture. A bit more info here:

    http://docs.unity3d.com/Manual/HOWTO-ArtAssetBestPracticeGuide.html

    If you want to automate this as explained above you can use plugins or possibly sprite packer in the unity 2D tools

    http://docs.unity3d.com/Manual/SpritePacker.html

    But for best results you probably want to start with a texture page, or you could end up with tiling sections taking up huge sections of your UV space so it can be better to plan out your mapping at source.