Search Unity

Multiple materials and textures from Blender to Unity

Discussion in 'Asset Importing & Exporting' started by aljaz823, Oct 17, 2018.

  1. aljaz823

    aljaz823

    Joined:
    Jul 2, 2017
    Posts:
    2
    Hello,

    as far as I'm aware some question of this kind have already been answered but I cannot find an answer to my particular problem.

    Long story short, I'm making a warrior character in Blender to be used in Unity.
    So far I have sculpted a high poly version, made a lower poly version using retopology workflow, UV mapped the LP version, and baked the Normal, Ambient Occlusion and Cavity maps from HP to LP. Everything so far works great.

    Now I have a problem because I'm not sure how to approach the painting/texturing of my low poly model. My character is a warrior so it has some parts of the mesh that would need a different material/texture than the rest, for example a breastplate or a helmet.

    Everything is a one mesh. And it should stay that way I think.
    So what is the best approach for this? I found some pretty cool and high quality textures online for golden-ish metal for example, how do I apply that texture with its normal and metallic maps that came with it, together with my current maps that I baked from HP model, how do I apply that texture only on one part of the mesh.

    Now I hope I'm clear trying to explain my problem.

    What I do know is how to apply different materials/textures to different parts of my mesh, and also how to bake the diffuse of those multiple textures together in one diffuse color map. But I'm not sure how to apply the multiple normal maps and such, since there would be one normal map for the whole model for details from the HP, there would be one normal map for the breastplate part of the mesh for the metal texture and so on.

    Thank you, I hope that was clear enough.

    I included what my model looks like, and my normal map from HP for details. Capture.PNG Capture1.PNG
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
    You don't really need to, unless your using a special SSS skin shader or something. With the Unity Standard shader, you can create a smoothness/metallic map so that different parts of the same materiel can be metal or not, and have a different levels of shininess. So you can have the skin portion of your texture be non-metallic and somewhat shiny, your cloth can be non-metallic and not shiny at all, and your armor can be metallic and as shiny as you want, all on the same material.

    It's better to have as few materials as you can get away with because each time the graphics card has to switch from one material to another, it takes a bit of time, which can eventually add-up. I've heard it's not much of a problem on desktop computers these days, but be aware if you'r making a mobile game.

    If you want to have separate materials, I'm pretty sure that all you need to do is assign those quads a separate material in Blender. Then when you import the model, each part that you assigned a material to should come in as a separate sub-mesh and you can assign individual materials in your object's renderer component.
     
  3. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    kdgalla has it pretty much spot on. One thing that I would add is that I've ran into issues with transparent materials. I had a model that was fully solid in the base and top, and had glass in the middle, similar to a futuristic reactor. I started with a single material for the whole thing since you can have an alpha map of course. When I was painting in in Substance Painter, I had no issues at all. But when I used that single material in Unity with transparency support, the model wouldn't render right, with parts of the glass showing outside the solid parts. But, once I made the materials separate, it worked perfect. I assume it has to do with how transparent materials are drawn in a separate pass from solid materials, but indeed using separate materials did the trick.

    The other time you might want separate materials would be for bigger multi-part models, like levels, or bigger buildings, and similar stuff. In these cases, a single material won't be enough to give you enough texture space for the detail you want to view things from up close(dependent on resolution, etc...). In those cases it starts to be a good idea to see where you can duplicate materials, go with modular assets that you can stick together seamlessly, and other things, all of which depend on your game and needs. Increasing texture resolution can help as well though, depending on what platform you are going for. It may or may not be enough for those bigger assets, once again, all dependent on your game and needs.