Search Unity

Lightmap UV issues

Discussion in 'Editor & General Support' started by Deleted User, Feb 22, 2016.

  1. Deleted User

    Deleted User

    Guest

    I've hit some issues with lightmapping in a large city scene. I've manually created UVs for UV0, UV1 and UV2 for all the road tiles and buildings and made sure "Generate Lightmap UVs" is unticked for all of them. I've tried several different lightmap setting configurations, I've reimported the meshes, I've checked the UVs of the .fbx files in a couple of different 3D modelling packages outside of Unity and they all seem fine.

    The problem is this, when the lightmap finishes baking some of the meshes in my scene get a dark triangle across them as though there is overlapping UVs. When I looked through the charting previews I can see the UVs are all scrambled for certain parts of the mesh. Does anyone have any idea what might cause this?

    I am using Unity 5.3.2f1.

    Issue screenshot and lightmap settings posted below:

    Screenshot shows actual issue along with Scene lightmap settings.
    Building_C_Issue_Main.png

    Screenshot shows object settings for that particular building. All buildings in the scene have identical settings.
    Building_C_Lightmap_Settings.png

    UV1 and UV2 layout as seen in MODO.
    Building_C_UVs.png

    Something very similar is happening to these road sections too.
    ADLightmapIssue_02.png
    Lightmap_Object_Settings.png

    Any ideas? I'm at a complete loss.

    P.S. If anyone has any extra advice for baking a large city scene with lots of buildings in it in Unity 5 it would be greatly appreciated.
     
    Last edited by a moderator: Feb 22, 2016
  2. Deleted User

    Deleted User

    Guest

    I copied the mesh (on the left, untextured) and the prefabs into a new project with similar lightmap settings, and have hit the same issue. I rebaked with Preserve UVs and Ignore Normals turned off but the issue remains.

     
  3. Deleted User

    Deleted User

    Guest

    I have raised the issue as case 773045 "Lightmap UVs scrambled on certain meshes" on the advice of Richard Fine.
     
  4. Deleted User

    Deleted User

    Guest

    So, for future reference and anyone else who encounters this sort of thing, it turns out these artefacts were caused by 4 faces whose UV coordinates had been scaled down to zero and so hardly visible on the chart. In MODO they appeared as as single vertex on the UV map but Unity handled them differently and they appeared as exploded, distorted faces.