Search Unity

Lightmap has separate line at the "tile floor"

Discussion in 'General Graphics' started by Kirshor, May 4, 2018.

  1. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    After bake lightmap, I have result as the image below, Could you help me to fix it?
     

    Attached Files:

  2. Yuvii

    Yuvii

    Joined:
    May 20, 2014
    Posts:
    55
    Hey,
    can you share a bit more details ?
    Like, are your ground tiles Planes ? Or Blocks ? Are they static (i guess so) ? Did you generate lightmap UV on these meshes ? What lights are you using ? Your lightmap resolution ? etc etc

    I can't really tell only by seeing a pic. Could be lot of different things.
    Cheers!
     
  3. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    Ground is a mesh that I recreate from origin Mesh by a script for new UV to work with atlas texture. I only translated the uv (chanel 0) of origin mesh to new uv (for new mesh), So I think the new mesh doesn't have right lightmap UV, I will check my code to fix that.
    More information:
    lightmap resolution=2048
    Ground is static.
    Light = Directional and Point, all lights have mode=Mixed

    However I don't understand why it only happens on a small area like in the picture, another area is ok!
    Thank you for your tip about "lightmap UV"
     
  4. Yuvii

    Yuvii

    Joined:
    May 20, 2014
    Posts:
    55
    Hey,
    I didn't get it all, but from what i understood your ground is from Unity's 3D primitives right ?
    In that case, UVs are already good (as long as the scale is 1:1), don't need to generate lightmap UV (i dont even think you can do that on unity's primitives).

    **************
    Little advice : Try not to use Unity's primitives. First because they're all in standard scales (1x1 unit mostly) and because you don't have control on every parameters on them (like Generate Lightmap UV for example). So even for ground tiles, i'll advice you to use an exported model, with your own scales, UVs, etc.
    *************

    If i did't understand well and your ground is from imported fbx, then check "Generate Lightmap UV" in the fbx's import settings



    An other thing you can try is play with the lightmap Padding (Lighting panel). It's by default aqual to 2, try 5 or 10, it may solves some artefacts issues.

    A last thing you can try is create a Lightmap Parameters (right click in hierarchy > Create > Lightmap Parameters), and uncheck "Edge Stitching". You can try other parameters too, then apply it to the gameobjects with lightmap issues (In its inspector > Mesh Renderer > Lightmap Parameters [..])

    Hope it helped
    Cheers!
     
    Last edited: May 7, 2018
  5. Kirshor

    Kirshor

    Joined:
    Apr 14, 2015
    Posts:
    24
    Very useful information. That helps too much!
    Thank you
     
    Yuvii likes this.
  6. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    Kirshor likes this.