Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

dark spots

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

  1. Jason_Hipkins

    Jason_Hipkins

    Joined:
    Dec 23, 2015
    Posts:
    51
    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:
    61
    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:
    51
    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:
    180
    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:
    51
    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

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    395
    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:
    51
    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

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    395
    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.