Search Unity

[SOLVED] Importing secondary UV channel for lightmapping

Discussion in 'Global Illumination' started by ArachnidAnimal, Oct 28, 2015.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,815
    Does anyone know whether or not it's possible to import a secondary UV channel in the 3d model to use for baked lightmapping? I've created a secondary UV channel in my Blender model, imported the model without selecting "Generate lightmapping UVs", however in the lightmapping atlas the charts seem to overlap itself when trying to not have Unity generate lightmapping UVs. So I am wondering if this is even currently possible in Unity 5.2.

    thanks
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    Baked (NOT realtime) lightmapping should respect the UVs.

    What you are describing should work.
     
    ArachnidAnimal likes this.
  3. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,815
    j
    UVchannel.png

    In blender, the secondary UV channel was created. It was imported in Unity. However, in the LB atlas it has overlapped itself, as noted by the blue line from the diagonals. With generate UVs seletected, the mesh appears fine in the atlas though.

    With generate UVs, it is fine:

    genUVs.png
    j
     
  4. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,815
    see my latest reply, i have a screenshot.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    How does the other channel look? (Is there a chance the UV channels are swapped and that's the 1st UV channel we're seeing in Unity?)
     
  6. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,815
    Channel 1. It is messy, but the unwrap is custom.
    channel1.png

    j
     
  7. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,815
    I figured out the problem. I had one of the large planes hidden in the Blender model (ALT+H), therefore it wasn't being added to secondary UV channel properly. User error.

    After correct lightmap pack in Blender:
    error.png


    I lost track of how many times I have burned my self by hiding meshes in Blender, and forgetting to un-hide them. :rolleyes:
    j
     
    Last edited: Oct 28, 2015
    impheris, TSC_Lindy and AcidArrow like this.
  8. TSC_Lindy

    TSC_Lindy

    Joined:
    Mar 6, 2017
    Posts:
    6
    You saved me, I'd also hidden some mesh. How ridiculous ^^'
    Thank you for sharing that afterwards!
     
  9. AshwanVIZARA

    AshwanVIZARA

    Joined:
    Feb 24, 2022
    Posts:
    1
    can you guide me , how you've assigned seprate channel of UV for Lightmap baking in Unity ! ( I've porps with 2 UV channel 1 with texture and other empty channel for Lightmap )
     
  10. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    lol

    lol x2