Search Unity

dark spots

Discussion in 'Global Illumination' started by Jason_Hipkins, Feb 4, 2019.

  1. Jason_Hipkins

    Jason_Hipkins

    Joined:
    Dec 23, 2015
    Posts:
    57
    Wonder what is causing this? I have an entire level that seems perfectly lit, and then I have this one corner where this is happening. I don't know, seems like weird overlap of the lightmap, but what value in the lighting settings would make it right? Any thoughts or opinions on this would be very helpful.
    lightingbug.jpg
     
  2. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey Jason_Hipkins,

    it looks like either the UVs are broken on this geometry, or it is single-sided. Can you check if either one of these applies here?

    Cheers
     
  3. Jason_Hipkins

    Jason_Hipkins

    Joined:
    Dec 23, 2015
    Posts:
    57
    These pieces are in fact, single sided. They are auto generating lightmap UVs.
    This particular piece is a building block, so its used throughout the level, but only seems to be having this issue in this one spot here. I got different results when I increased lightmap padding to 3, but not necessarily the correct results I'm looking for just yet.
     
  4. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    I would try the invalid texel debug scene view and the UV overlap debug scene view. Can you post images of these? Also the baked lightmap scene view would be helpful to rule out rendering issues.
     
  5. Jason_Hipkins

    Jason_Hipkins

    Joined:
    Dec 23, 2015
    Posts:
    57
    Here is screenshot of the texel validity view. The UV overlap debug view was identical. Sorry for the delay in this response. I do not seem to have any issues with this corner when I use Enlighten to bake my maps rather than Progressive. Still would like to figure out why in case this issue rears its head again. Again, thanks for giving this a look
     

    Attached Files:

  6. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Hey @Jason_Hipkins,

    Unfortunately most of the debug views are available only during the bake and right after. The data is gone when switching to another scene or quitting the Editor.

    Could you perhaps restart the bake? You don't even need to wait for the bake to fully finish. You can enable view prioritization and focus the scene view camera on this problematic corner and wait a bit, say a minute.
    Then cycle through the visualisations that Jesper mentioned and please send screenshots of those.
     
  7. Jason_Hipkins

    Jason_Hipkins

    Joined:
    Dec 23, 2015
    Posts:
    57
    Prioritize view for some reason did not work for me, so this is a much lower resolution so things could finish rendering. I admit I see a lot of red, but I have to say I'm not sure what any of it means, or how to fix it.
     

    Attached Files:

  8. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Please check out
    texel validity
    in:
    and
    backface tolerance
    in:

    In essence when we shoot rays from a texel they can hit backfaces of single-sided geometry. If a lot of those rays hit backfaces then we mark the texel as invalid, assuming that it's within some other geometry (e.g. it's part of a floor that is within a wall). That allows us to then fill that texel with lighting information from it's neighbours. If we didn't do that, it would most likely be black and, in case of the example with the wall, the floor would appear black next to the wall.

    Please check your geometry. The best ways of dealing with the issue is to make sure that all your texels on visible geometry see only front-faces. That can be achieved by:
    • flipping the single-sided geometry
    • making single-sided geometry two-sided
    • using the
      Double Sided Global Illumination
      flag on a material to make a single-sided piece of geometry appear two-sided to the lightmapper
    That should give you a texel validity view that is mostly green with a small touch of red where geometry intersects.
     
    RaL likes this.
  9. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Then why does this not get fixed?
    Did you know that it is time consuming to bake again just to view the debug overlay? And that this stalls the work an that machine? Also it is not really a substainable behaviour to waste energy again for a senseless same rebake. The energy just not come out of the plug ...