Search Unity

[SOLVED] GI : Baked mesh parts completly black / No light stored in lightmap

Discussion in 'Global Illumination' started by Eldoryne, Jan 14, 2016.

  1. Eldoryne

    Eldoryne

    Joined:
    Jan 9, 2013
    Posts:
    11
    Hello everyone.

    I'm facing an issue with gi, and after tons of unsuccessful tests, i'm asking the community.

    Setup :
    • Large building (4000m²) with interiors, baked with sun (Directional Light) and procedural skybox as ambiant light.
    • Also lightprobes + local reflections probes + area lights for the interiors
    • No realtime baking, as its not needed in this project
    • Last Unity version 5.3.1f1, but problem is here since at least 5.2, when i started this project

    Problem :
    • Some faces of some meshes in the project seams to see no light when baked, and show up completly black, messing up post effets with random large black squares on screen.
    • [!] If i put an area light next to a black part, the baking goes well [!] (it is this test making me think it's a lack of light which cause the problem, and not a problem with meshs nor UV's)
    • Rest of the scene is OK.

    Some Screens to help describing the issue :

    • Screen of current baking (interior) : currentbaking.jpg
    • Screen of post effect mess (simple blur) : posteffects.jpg
    • Screen of a wrong mesh part : currentproblem.jpg
    • Screen of baking settings / passes : settings_passes.jpg

    Notes :
    • Same problem on two differents PC's.
    • All objects use the Deflaut lightmap profile, except for large exteriors objects, and some building roof large parts which use a low resolution one.
    • I have already splitted up my building in smaller parts because enlighten seams to not like big objects
    • I had exaclty the same problem on a other exterior / interior project of mine which contains much less meshes.
    • No setting in the main lightmap window seams to affect this problem.

    So, what am i doing wrong ? Is there a way to force storing a minimum amount of light to avoid that deep darkness :D ? Because my ambiant light is set on 2 so i don't understand why no light baked on some mesh parts could possibly happens.

    If you want more informations don't hesitate to ask, this issue is driving me nuts.
    Thanks, and sorry for long post ^^
     
    Last edited: Jan 14, 2016
  2. Eldoryne

    Eldoryne

    Joined:
    Jan 9, 2013
    Posts:
    11
    Finally found a workaround !

    Like I thought, some mesh faces of my building where indeed excluded from lightmapping because of the ratio : received light rays from front face / received light rays from back face.

    It make sense in my case since my bluiding is divided in two parts : exterior shell and interior parts.

    This way, a face of the exterior shell can receive a low amount of direct/indirect light rays on the front face (specifically the shadowed part of the building), and much more rays from the backface (backface exposed to the sun in this configuration).

    The lightmapping process consider this kind of faces to be inside the geometry (thus not visible) and exlcude it from baking, therefore appearing black in the end of the process.

    So to avoid it, create a lightmap parameter for the concerned mesh objects and put the backface tolerance to 0 -> solved.jpg

    I don't know if it has a huge impact on baking time to put this parameter on 0, if someone can answer me, so i maybe could put all my mesh object with this lightmap settings.
     
  3. jAchtzehn

    jAchtzehn

    Joined:
    Dec 17, 2015
    Posts:
    6
    Hi Eldoryne,

    just wanted to thank you for coming back and posting your solution. Had the same problem in my environment and your workaround fixes it to some degree (although the black mesh parts are still a little darker than the rest). However, I get usable results now.

    Thanks!
     
  4. Eldoryne

    Eldoryne

    Joined:
    Jan 9, 2013
    Posts:
    11
    Glad it was useful for someone of the community, it was a hard time to understand the issue and found the workaround :D
     
  5. thonk

    thonk

    Joined:
    Nov 28, 2012
    Posts:
    6
    Also wanted to say thanks! This helped me solve this problem that plagued me for months.

    To add on to the solution, I also found this thread through after find this one.
    https://forum.unity3d.com/threads/lightmap-problem-black-objects-unity-5.312422/

    I also noticed that sometimes I had single blacks squares flashing on and off around parts where two of my walls connect, and I realized that behind the seam (possibly very far away) there was some geometry that also had the backface tolerance problem.
     
  6. dom_cobb_22

    dom_cobb_22

    Joined:
    Feb 6, 2014
    Posts:
    24
  7. sohamsamy

    sohamsamy

    Joined:
    May 28, 2021
    Posts:
    1
    LIGHT MAP appears Black In certain parts on an object , having this issue using URP please someone hlp me out where i am doing wrong,
     

    Attached Files:

  8. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    327
    This thread is pretty old. If you are experiencing a similar issue, I suggest opening a new thread and/or filing a bug report.

    Could to take a screenshot with "Texel Validity" scene view mode? https://docs.unity3d.com/2019.1/Documentation/Manual/GIVis.html