Search Unity

Artifacts after Baking light

Discussion in 'Global Illumination' started by katnyan, Feb 17, 2018.

  1. katnyan

    katnyan

    Joined:
    May 12, 2017
    Posts:
    25
    Hi,

    I have been baking light within the scene and there are some weird artifacts appearing at couple of places.

    I have selected the Generate Lightmap UV's in the fbx file. Also, verified the model by applying the texture in Maya.

    The issue happens only when the light is baked. PFA the image where the artifacts are hilighted in red after baking. The part of image on the left is before baking the scene.

    Why is this happening?

    upload_2018-2-17_18-4-8.jpeg

    EDIT:
    Below is the image with shaded wireframe(ShadedWireFrame.jpg), it seems the artifacts are appearing at some of the verts. Verified the UV map and it seems fine.
     

    Attached Files:

    Last edited: Feb 19, 2018
  2. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    Increase scale in lightmap value on this objects.
     
  3. katnyan

    katnyan

    Joined:
    May 12, 2017
    Posts:
    25
    @YouDesign ,

    I have increased the Scale in Lightmap for the GameObject and baked. But, it doesn't had any effect on the artifacts.

    However, I have tried baking the scene with Progressive Lightmapper with "Stitch Seams" enabled on the GameObject and the artifacts seems to disappear. So I guess, the issue is with Unity unwrapping the gameobject on the lightmap.

    I am looking to bake the scene in Enlighten due to Internal reasons. So, now that we have an idea on why this is happening, is there any way we could do to remove the artifacts using the Enlighten lightmapper.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    You should really make your own lightmap UVs.

    I mean Unity's lightmap generator often produces great results (it has a pretty decent algorithm), but still if you want things to look certain ways you should make your own UVs.

    What I usually do is, have generate lightmap UVs on when I'm still changing things around and when I think the geometry is close to being done, I make my own UVs.
     
    Sentinel_86, JonasLuz and ron-bohn like this.
  5. ron-bohn

    ron-bohn

    Joined:
    Oct 5, 2015
    Posts:
    306
    Thank you for this suggestion. It's something I am now looking into learning more about.
     
  6. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Personally, I have spent numerous hours with the question, "Why is it getting artifacts?" The cold hard truth is that lightmap baking requires a lot of preparation. It includes UV adjustment, scale adjustment, probe adjustment etc. When I first started lightmapping, I figured pressing the "bake" button and the long wait time was all that is required. But really, it requires a bit of elbow grease, and lots of rebaking (Progressive baker makes this slightly easier with view prioritization).

    Even with all that elbow grease, sometimes you will get strange results, then you'd have to go back and forth with the Unity representative to finally find out there are clear limitations with the baking tech. I am not trying to bash the lighting engine or anything. Just trying to tell that lighting takes a bit of a know how and effort.

    I'd suggest you to read up on known issues first and how to work around them before

    Nowadays, I just try to keep minimal lightmap and resort to light probes. Not only is it much faster (with less things to bake) but I get less things to adjust in general. Proxy volume probe is a very nice component that goes with this approach. Hope this helps.
     
    Sentinel_86 and JonasLuz like this.
  7. highpockets

    highpockets

    Joined:
    Jan 17, 2013
    Posts:
    71
    I was able to get rid of most of the artifacts by enabling Double Sided GI on the trouble object materials/shaders. I know this is an old thread, but I came across it a week ago while trying to sort out ugly lightmap issues and I tried a lot of things including importing everything with manually created secondary/lightmap UVs. Double sided GI was the only ticket. Hopefully someone finds this before going mad for an entire week
     
    CWatsonT2, Jijzo, AlkisTag and 3 others like this.
  8. ay_ahmet

    ay_ahmet

    Joined:
    May 17, 2021
    Posts:
    5

    This was the solution to my problem too. Thanks.
     
  9. Jijzo

    Jijzo

    Joined:
    Mar 28, 2020
    Posts:
    3
    This also worked for me too, thank you!