Search Unity

GI - Baked Point Light - Blotching/Black spots

Discussion in 'Global Illumination' started by Nullzero, Apr 19, 2015.

  1. Nullzero

    Nullzero

    Joined:
    Apr 24, 2013
    Posts:
    12
    Case 690662

    Screenshot of phenomenon in Scene View, using the Baked render filter:

    bug1.png

    You can see the point light, the black spots on the table, and the black wall, with some buggy noise on the black wall.

    Here is the work-around I used... Please post here if it helps you.

    1) Go to Window -> Lighting -> "All" Tab
    2) Click on the buggy problem object in the Scene
    3) Look at the Preview Pane in the Lighting Window. Choose "Baked Intensity" from the Preview Pane display type.
    4) Observe the UV positions:
    bug2.png

    And for the desk and TV:
    bug3.png

    If you look at the UVs for the Desk+TV, and the UVs for the black wall, you can see they overlap.

    We must separate them. Maybe there are better ways to do this than my method. If you find a better method, please share with everyone.

    1) Go to Project View, then Create->Lightmap Parameters
    2) In the Lightmap Parameters Inspector, change the following:
    a) System Tag to any number other than -1
    b) Baked Tag to any number other than -1
    bugcustParam.png

    3) Select the biggest overlapping object. In my case, it was the black wall.
    4) View the object in the Lighting Window (NOT the Inspector window)
    5) Change the Advanced Parameters to your newly created Lightmap Parameters. Observe:
    bug4.png

    6) Observe the Preview Pane. It should not longer have the old overlapping UV objects. This is because we changed the Baked Tag and System Tag for its Lightmap Parameters.
    7) Also, Observe that UV positions for the Wall. It's WAYYY outside of the Baked Intensity texture map. The UVs are only showing maybe... 2 sections... But it should be somewhere closer to 5 or 6 sections. We must scale it down.
    8) Change the Scale in Lightmap value to something smaller than 1. Make it so the UVs fit within the Baked Intensity texture:


    This... seems... to have fixed the problem for me. If it works for you, please post below. If you find an easier way, please post below.
     
  2. Sparrowfc

    Sparrowfc

    Joined:
    Jan 31, 2013
    Posts:
    100
    That is really a practical solution, why no one comment?
    As for my case, I have too many objects to bake. And the artifacts is significant just looking at the baked lightmap. When I apply the method you posted, all objects with new custom Advanced Parameters are rendered in to a new lightmap which is clean and not black spots or strips.
    Now I'm wondering maybe the scale of the scene cause it?
     
  3. Sparrowfc

    Sparrowfc

    Joined:
    Jan 31, 2013
    Posts:
    100
    increasing the lightmap size can eliminate those black spots too, so I start to wonder if the low resolution of lightmap causes the problem. Then I find words in documents "The Directional with Specular mode pushes the lightmapper to the limits of the GI technique it uses, which in some cases leads to artifacts. These are most often patches of incorrect dominant light direction, causing dark or black shading. Some of these issues can be fixed increasing the Realtime/Indirect Resolution. If all else fails, the simpler lightmap modes are more robust.". If I understand correctly, that means the resolution and baking mode is related to the problem.
     
  4. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Hey Nullzero,
    Thank you for submitting the bug report. I updated the info here: http://issuetracker.unity3d.com/iss...irection-uv-maps-overlapping-causing-blotches

    For your convenience:
    "UVs not filling the entire 0-1 space, either smaller or bigger (as in this case), would cause the packing to go haywire. It would manifest itself in UV islands overlapping (causing black blotches), in resolution being calculated incorrectly (hence the object would get too low or too high amount of texels) and the UVs being stretched. It is now fixed in 5.2 and the fix will be backported to 5.1."

    The reason for this issue to happen in your particular case was that the wall mesh doesn't have proper lightmapping UVs. They are not enclosed in the 0-1 space, but rather span from -1 to 4. Checking "Generate Lightmapping UVs" on the model importer will fix your issue.

    Your case made us uncover a set of related issues though and all of them are now fixed. :)

    Cheers!
     
    Nullzero likes this.
  5. Ddnova

    Ddnova

    Joined:
    Jun 19, 2015
    Posts:
    1
    You beat me to it. Had the same problem and checking the "Generate Lightmap UVs" on my model inspector fixed the problem.
     
  6. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I have the same problem on Unity 5.2.2 and it is NOT exclusive to objects without auto-generated lightmap UVs. Every single object in the scene has Generate Lightmap UVs option enabled:


     
  7. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Hey @bac9-flcl,
    We don't have a bug on a case like yours. Could I perhaps ask you to submit the scene above in a bug report and post the case number here?
     
  8. quitebuttery

    quitebuttery

    Joined:
    Mar 12, 2011
    Posts:
    329
    This bug is still present in 5.3.
     
  9. legendaryvr

    legendaryvr

    Joined:
    Oct 19, 2015
    Posts:
    6
    @Kuba check case 755188
     
  10. Zenggang

    Zenggang

    Joined:
    Sep 22, 2015
    Posts:
    5
    still happening in 5.4.1
     
  11. felix_of_mars

    felix_of_mars

    Joined:
    Jul 25, 2013
    Posts:
    21
    AutoUVs are not designed for baking, they are for the chart textures that dynamic produces. You will need to manually author the baked UVs. Each face should be fully unwrapped and not overlaid.
     
  12. deflix73

    deflix73

    Joined:
    Aug 1, 2015
    Posts:
    5
    Really? So for old school bakes I cannot use auto UVs on import?
    Is this 100%
     
  13. Chao0707

    Chao0707

    Joined:
    Dec 26, 2016
    Posts:
    1
    Try to arrange your UVs in 3D software, make sure they won't have any overlap.
    That's the way i solve my problem.
     
  14. profesar

    profesar

    Joined:
    Sep 29, 2016
    Posts:
    2
    still happening on 2017.1.03f
     
  15. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @profesar

    Please open the Lighting window, find Object tab. You'll see the Preview tab and by default, it is set to Albedo. Switch that from Albedo to Baked Intensity. Now find and click on the object where you encounter the artifacts. You'll see the baked lightmaps of your object in the Preview window. Normally, UV charts should be at least 2 full texels apart from each other (because of dilation) and none of them should overlap. So please send how your UV layout looks like along with a screenshot of your scene view so we can debug your problem. We don't have any known issues about this problem in 2017.1.0f3 so we would really appreciate if you can provide more information about this. Thank you!
     
  16. AlClar1ty

    AlClar1ty

    Joined:
    Oct 26, 2016
    Posts:
    1
    In Unity 2017.2.0f3, the problem still in there... sometimes its getting worse...
     
  17. LazyPeach

    LazyPeach

    Joined:
    Mar 24, 2018
    Posts:
    1
    How to fix that weird black seams on round objects? upload_2018-3-24_16-45-0.png
    The version is 2017.3.0f3. I searched for it a lot but i couldn't find any solutions.
     
  18. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hi @AlClar1ty and @ LazyPeach

    We never managed to backport the fix to 2017.2. Please download the latest version of 2017.3 from Patch Releases: https://unity3d.com/unity/qa/patch-releases

    It seems like you have lightmap UV issues (i.e. overlapping UVs). I recommend reading this post: https://forum.unity.com/threads/strange-bake-artifact-5-5-3.467559/#post-3071791

    Thanks