Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Using imported UV2 for baked lighting doesn't work

Discussion in 'Editor & General Support' started by artur-leao, May 21, 2015.

  1. artur-leao

    artur-leao

    Joined:
    Feb 3, 2015
    Posts:
    66
    I'm currently using UV0 and UV1 for maps and detail maps but I want to be able to use UV2 to be used for lightmaps.

    I'm exporting this as FBX from 3dsmax, which means UV0, UV1 and UV2 correspond to map channel 1, 2 and 3 respectively.

    The problem is that Unity ignores UV2 and seems to be using UV1 coordinates for light baking. I don't understand why this happens since Unity has an option to generate a separate UV2 if we decide to generate lightmap UVs inside Unity.

    Shouldn't it use our own UV2 if present?

    Thanks!
     
  2. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
  3. artur-leao

    artur-leao

    Joined:
    Feb 3, 2015
    Posts:
    66
    Thanks for your reply Findus but that's the thing, using UV2 created by Unity allows it to be used for baked lightmaps, I just wish we could use our own UV2.
     
  4. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    Just to avoid any confusion: UV2 is reserved for realtime GI, not "normal" baked lightmaps. Those always use UV1 as far as I'm aware. The only thing you can do by default is tell Unity to use UV1 for realtime as well.
    Sorry, don't really have a solution other than maybe creating your own material variants that e.g. take detail UVs from UV3. (Or UV2 if you can tell Unity to let that completely alone and don't need realtime GI. ) Seems easier than the other way round, at least for someone like me with no programming experience.
     
  5. artur-leao

    artur-leao

    Joined:
    Feb 3, 2015
    Posts:
    66
    I see, thanks again. I prefer not to mess with creating new shaders, not worth the time. I'll probably bake it in the uv1 and discard what I'm using the detail maps for.