Search Unity

Lightmap on modular objects

Discussion in 'Global Illumination' started by oliv_3r, Jun 25, 2019.

  1. oliv_3r

    oliv_3r

    Joined:
    Apr 9, 2015
    Posts:
    9
    Hi everyone,
    I am encountering a problem on lightmap seams with different meshes created with ProBuilder
    Change lightmap padding or pack margin do not change anything.
    Any idea on that problem ?
    Thank you.

    seam.JPG settings.JPG
     
  2. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    Look at UV charts in scene view, it might be a case where different meshes have been combined into a single UV shell.

    UV charts can be enabled in scene view.
     
    Last edited: Jun 27, 2019
  3. oliv_3r

    oliv_3r

    Joined:
    Apr 9, 2015
    Posts:
    9
    Thanks for your reply @iSinner, UVCharts in attachment.

    charts.JPG
     
  4. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    They should be color coded, looking something like this:

    What you attached looks like UV charts have not been created at all, which makes me think you looked into the wrong section. Was that from Baked GI or Realtime GI section? your realtime GI is disabled in LM settings, so if you switched the scene view to UV charts in realtime GI section, this is what i would expect to see, which is of no help at all.

    I recommend you to look into this tutorial, it is a bit dated in terms of some options do not match word for word, but aside from that its very good and it explains what is going on and how GI works, which will help you greatly identifying your problem.

    There may be a lot of reasons for the artifacts you showed, the one that came to my mind was incorrect UV charting due to mesh renderer settings on these objects, maybe they don't have UV's for light mapping, maybe something else is going on.

    We can go back and forth on it and it will take a lot of time, the faster way would be for you to read the tutorial.

    One more thing, make sure the mesh has UV's for light mapping, because if it doesn't there will be all sorts of weird glitches. When you import a model there is a checkbox for it, to generate UVs for lightmapping, but for meshes generated with builder i'm not sure how this is achieved, but UV's for LM have to be present in the mesh data to work properly with LM.
     
    Last edited: Jun 27, 2019
  5. oliv_3r

    oliv_3r

    Joined:
    Apr 9, 2015
    Posts:
    9
    Thank you @iSinner.
    What you looking for is called "Lightmap Indices" now (in attachment).
    All walls are generated from ProBuilder, so the lightmap settings seems to be good i think.
    As you can see, there are no other problems like that in the scene, juste in this case where 3 pieces of walls are separated.

    indices.JPG home.JPG
     
  6. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    Try playing with these

    settings in the mesh renderer of those objects, increase the max angle to 93 see if it helps, make sure that max distance isn't 0 to allow close by meshes(colorcoded with pink) to be stitched, or make it 0 instead to forbid stitching in case that mesh colorcoded with blue is stitched with some other mesh from above it, which produces color bleeding, it will take a little bit more space in the LM textures but it might eliminate the artifact.

    I have a feeling that, that blue part goes up under that other mesh and the shadow is bleeding down from above. Try separating that blue mesh into two meshes, one that stops at the ceiling, and another one that continues from there onward, but make sure they are not getting stitched together when UV Shells are created, and to ensure that you can decrease the max distance to 0 on those two meshes. This is in order to avoid any bleeding artifacts, assuming that is the issue.

    I hope any of this helps.
     
  7. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
  8. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    Try assigning a different "Baked Tag" to those wall meshes