Search Unity

On build, Lightmap UV is broken on specific scene / prefab when using unlit (support lightmap)

Discussion in 'General Graphics' started by bomul0327, Jul 5, 2019.

  1. bomul0327

    bomul0327

    Joined:
    Oct 2, 2015
    Posts:
    14
    Hello.
    When I build lightmap, it looks ok in editor. However, when I build it, it looks very bad. It seems like uv is broken. The weird thing is that when I build specific prefab, it goes wrong. Other objects looks normal both in editor and build. What could be the possible reason?
    I used Bakery to build my lightmap, but I think this is not a problem. other scenes/prefabs have no problem using Bakery. I tried Unity's progressive Lightmapping, but the problem was not fixed.
    I also checked Genereate UV options.
    I uses my custom shader based on Mobile/Unlit (Support lightmap). But I tested on Unity's unlit shader. It also shows problem.

    This is from editor
    Normal.PNG

    This is from the build
    Not normal.PNG
    Any helps are appreciated.
     
  2. bomul0327

    bomul0327

    Joined:
    Oct 2, 2015
    Posts:
    14
    I digged for few days, I got answer for my case.
    Try to disable Project Settings -> Player -> Other Settings -> Optimize Mesh Data.
    If this is checked, it blow your second uv sometimes.

    If you do not want to disable this option, try to change order of uvs in Shader (texcoord0, texcoord1 ...). It worked for me, but I need to check why it does.
     
    tirarex likes this.