Search Unity

Question Proper practice for lightmapping and UVs?

Discussion in 'Global Illumination' started by Fennec_Fyre, Jan 7, 2024.

  1. Fennec_Fyre

    Fennec_Fyre

    Joined:
    Oct 28, 2016
    Posts:
    16
    In the past when making assets, I've frequently layered UVs on top of eachother to save space if the objects in question should be symmetrical--such as bolts on the side of a bucket that would all look the same, or mirrored halves of a symmetrical object. When my team started incorporating lightmapping into our work, I figured out pretty quick how that messed with lightmaps. It was easy enough to fix just by generating new, un-overlapping UVs for objects and having the lightmap pull from that instead of the old UVs the texture and other maps use, but is this good practice? Am I still okay to have UV pieces layered on eachother for efficiency's sake for texturing and then make a different UV map for lightmapping, or should I only have one non-overlapping UV layout that gets used for everything?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    This is fine, Unity generates a second UV channel for lightmapping anyway (based on the 1st UV if you don't supply a second, otherwise it's based on the 2nd), so you're ending up with 2 uv channels regardless of whether you supply one or two.
     
    Fennec_Fyre likes this.
  3. Fennec_Fyre

    Fennec_Fyre

    Joined:
    Oct 28, 2016
    Posts:
    16
    Good to know, thank you. So does this mean that, of the four UV channels an object can have, one of them is always reserved for lightmapping?
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    I am not 100% sure if anything is different for HDRP, or if there is a recent change I'm unaware of, but I think so, yes.
     
    Fennec_Fyre likes this.