Search Unity

Unity Multiple UV Maps for an Object

Discussion in 'General Discussion' started by AnasEBarakat, Jun 16, 2021.

  1. AnasEBarakat

    AnasEBarakat

    Joined:
    Jul 9, 2019
    Posts:
    4
    Hello,

    I have a query regarding UV mapping in Unity 2019.4.1 1f1. Within Blender, I created 2 UV maps for an object, one UV map was set for the normal map of the object, the other UV map was set for the texture's/albedo's map.
    When I export this onto Unity as an fbx, Unity is only taking the UV map of the normal map and applying that to both the normal map and the texture/albedo map of the material.

    How can I make the material behave the way it does within Blender where the Texture/Albedo is mapped using the its own UV map and the normal map is mapped using the other UV map?

    P.S: Apologies if I'm misusing the terminologies, I just started diving deep into modelling and materials from Blender into Unity.
     
    Last edited: Jun 16, 2021
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    Im confused as to why you would put your normal map in a different UV channel, that makes no sense

    What are you trying to achieve by doing this? Why would your normal map need different UVs to your albedo/base color map?

    It sounds more like you misunderstand what UV maps are for and how they are used, but I could be wrong and its hard to know without more context - there are genuine reasons for doing this in some cases but if you are just starting out I doubt that is the case
     
  3. AnasEBarakat

    AnasEBarakat

    Joined:
    Jul 9, 2019
    Posts:
    4
    Hi,
    I may have misunderstood some parts, but my reason for doing so is because I generated the normal map for the object by modelling a higher definition model, and then baking a normal map from that object onto a lower definition model. That worked fine and all, but when I tried applying an image texture onto that model which js completely independent of the normal map, it was not aligned to the normal map as I would want it to.
    For that reason, I tried to align the normal map and the image texture for that object by creating two separate UV maps.

    If there is a better solution, I am more than happy to get some feedback.

    Thank you
     
  4. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    Sounds like a detail normal map? In that case you can just assign a detail normal map and select UV set 2 for it if you're using the standard shader.

    If you create a custom shader you can select what UV to use directly.
     
  5. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    Have you read this resource before by any chance: http://wiki.polycount.com/wiki/Texture_Baking

    Its a great resource to clearly explain most things involving 3D.

    If you look through those steps it should clearly explain what to do and why.

    Basically - you want the same UVs for both normal map and the albedo as they are both mapping to the same 3D geometry. The normal map should contain all the info from the high when it was baked, if it was baked properly. It is mapped to the low poly as that is what will go into the engine, so thats correct.

    If its not "aligning" there is something wrong somewhere else, you shouldnt attempt to make a set of UVs from your high poly as a UV1/2 or whatever.

    So walk backwards using that guide and try and work out what you are doing that is wrong :) Good luck!


    It doesnt sound like that, it sounds like they are trying a high to low baked workflow for modelling and are at the normal map stage of that workflow, and having issues baking their high to low normal map
     
    Last edited: Jun 16, 2021
  6. AnasEBarakat

    AnasEBarakat

    Joined:
    Jul 9, 2019
    Posts:
    4
    That sounds like a geniune solution, I will have a look.
    Thank you for your quick help! :)
     
  7. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977
    You are most welcome, feel free to message back on here if you still hit issues :) Its a common workflow a lot of people in this community have experience with, so I am sure you will get there in the end :D
     
  8. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,566
    It can make sense in some scenarios. For example, flat color, normalmap detail. Or detail normals.

    Although normally normal map has same UV as albedo/base color.