Search Unity

Lightmap is not smoothed on specific area of my object

Discussion in 'Global Illumination' started by impheris, Feb 9, 2022.

  1. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    Hi everybody. I'm having this little (not that important) problem with my lightmap, i'm making a little cute building with a rounded ceiling on the edges, but the lightmaper does not smooth that part of the object :(
    Look at the screenshots before reading the following.
    I already tried the following:
    * Disabling and enabling "Stitch Seams"

    * Put more poligons on that area, Put less poligons on that area, edit the settings for the "autogenerate lightmaps uv" tool in the importer.

    * Modify the lightmap parameters.

    *Disabling and enabling AO.

    *Higher lighmap sizes.

    *Higher samples.

    *Disabling and enabling filtering.

    *Ttried different values for the "smoothing angle" on the importer.

    All the points on that area are welded and merged correctly in my 3d software
    I tried all of that stuffs and is the same effect. The only way to get rid of that effect is with a higher lightmap resolution, right now is 30 (texels per unit) but even in 50 i'm getting the same effect (and of course that is too much), i tried with 100 and the line is still barely there.
    I think i tried all, but, is there something else? what i'm missing?

    Edited, additional info: I'm Using 1 directional light with soft shadows (shadow angle 1) i also have 2 area lights but those are inside the building and also disabling those light does not change anything related to my problem.
     

    Attached Files:

    Last edited: Feb 9, 2022
  2. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. Most likely the issue you encountered is caused by how Unity generated the Lightmapping UVs. Can you select your building ceiling, open the generated lightmap and make a screenshot of it.?
     
  3. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    Hi, thank you for answering. I separate the ceiling poligons for the original mesh and export it, because in the original mesh, is just a 1 layer mesh, so i'm just baking those few polys now, i'm having the same problem but i look at the UV Overlap view and the uv is not continuous (see UV overlap screenshot), is from the complete building, it has the same error in just the ceiling too
     

    Attached Files:

    Last edited: Feb 9, 2022
  4. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    I would recommend you to create your own custom lightmap UVs for the ceiling. This way you can decide yourself where the seams are located.
     
  5. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    I'd second what @Nicrom has suggested. Generate lightmap UVs in a DCC program. Keep in mind that if you have a smoothing split, you'd need to have a UV split. The opposite is also true.
     
  6. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
  7. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    Can i do it on Lightwave?
    Some lightwave's user are saying that unity does not support UDIMS
     
  8. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Yes, you should be able to do that in Lightwave as well. Make sure that lightmap UVs are in the second UV channel.

    And that is correct, Unity does not support UDIMs for lightmapping.
     
  9. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    I tried yesterday, Lightwave makes the same mistakes jajaja, so i need to create and modify every piece by hand, a lots of waste of time -.-" anyway. Thanks guys.
    BTW: i found a little tool that can be useful, is a uv editor for unity. It does not help in my case, but maybe other devs can find it useful
    https://assetstore.unity.com/packages/tools/modeling/uvee-6933
     
  10. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Try the following solution:
     
  11. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,661
    Hi, Thank you for the help. I already tried all those settings. I know that making bigger lightmap resolution can help a lot due to better smoothing, but my game is a mobile game, so i need the best performance-quality i can get so my best solution is to edit the UV map in my 3d software, it is a lots of work and wasted time, even for low poly objects but is my best bet right now. Anyway Thanks for your reply
     
  12. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    580
    Using a tool like 3dsmax helps you understand better how to configure your Unity automatic UV mapping for lightmaps to avoid such problems.

    To configure this properly, you have to think of what Angle setting would be best for your object as if you are using 3dsmax "AutoSmooth".

    Configure that Angle in the same value you would give to AutoSmooth.

    If you think AutoSmooth would not do a great job on your model then that means you should probably do these lightmap UVs in your DCC of choice.

    In the vast majority of cases AutoSmooth does a perfect job. And so does Unity's Automatic UV for Lightmaps. This comes with experience, and eventually you can tell which model is worth spending time and effort on manual unwrapping for lightmaps and which one isn't.