Search Unity

Dark "Wet" spots artifacts after baking

Discussion in 'Global Illumination' started by webik150, May 4, 2022.

  1. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    Hi, I've tried searching the forums but didn't find this issue yet.
    When I bake my scene, I get these dark spots on the ground. The doors aren't static and there is a hole behind them leading into a completely black room.
    upload_2022-5-4_19-20-35.png

    It doesn't happen with every door, but with like 80% of them
    upload_2022-5-4_19-24-26.png
    upload_2022-5-4_19-25-51.png

    Any ideas why this is happening? I'm using URP and the GPU preview lightmapper on a rtx3070. I've tried playing around with different lightmapper presets to no avail, Backface tolerance also doesn't seem to do much.

    Unity ver. is 2020.3.19f1
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
  3. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    I skipped out on half of that because I don't have the Double GI option in my material settings

    But on Your prompt I've tried turning the materials of the map double-sided and that helped, artifacts are gone (and so far doesn't seem like it broke anything else)! Thanks!
     

    Attached Files:

  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Sounds like the real fix here is examine the normals of your objects, and in some cases give them thickness.
     
  5. webik150

    webik150

    Joined:
    Mar 23, 2013
    Posts:
    62
    The thing is, I’m trying to save space by only keeping the visible polygons (when I had the mesh solid, the lightmaps took up 2x the space). Like all the source games do and most games in general.
    What the issue might be is that the map is split into separate rooms, which are separate meshes (split inside the door frame). No idea how to fix that up tho.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    When lightmap texels "see" open backfaces they assume they are inside geometry and they are filtered out (in order to not produce really dark texels near intersections).

    One workaround that hasn't been mentioned is to actually add a separate mesh that is used only for baking that adds thickness to meshes and hides open faces.

    You can set it to a lightmap scale of 0 (since you don't want it to actually get lightmap baked) and mark it as editor only so it doesn't get included in your builds. (plus attach scripts that disable it on play, so that they don't bother you when playing in the editor).
     
    webik150 and hippocoder like this.