Search Unity

How do disable self-shadows in baked lightmaps?

Discussion in 'Global Illumination' started by sarahnorthway, Mar 24, 2021.

  1. sarahnorthway

    sarahnorthway

    Joined:
    Jul 16, 2015
    Posts:
    78
    I have flat realtime lighting that looks good with our stylized art, but is slow and supports a limited number of light sources. When I convert it to more efficient baked lightmaps, the fancy raytracing radically changes how the lights look, making them much brighter and applying self-shadows to 3d objects even when Cast Shadows and Receive Shadows are both off. It also ignores the culling mask.

    Is there a way to make baked lighting look more like our realtime lighting? I'm using Default-Medium lightmap parameters but don't see any obvious settings that would help. I can (awkwardly) work around the brightness and culling masks, but the dark self-shadows specifically are a problem.
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Indirect baked shadows cannot be disabled, unfortunately. Also, culling masks currently do not work with baked lights.
     
  3. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Try setting Max Bounces to 0 in the Lighting window and make sure Ambient Occlusion is disabled.
     
    Jiaquarium likes this.
  4. sarahnorthway

    sarahnorthway

    Joined:
    Jul 16, 2015
    Posts:
    78
    Hmm yeah I had them both disabled, and they don't seem to make a big difference except to baking time. More bounces actually appears to make the self-shadows a bit less dark.

    But as a solution I went with hackily un-doing the shadows in the object textures, so lightening places in photoshop where the baked self-shadows were a noticeable problem. Alternately I could have edited the baked shadow textures, or I could have forgone lighting entirely and baked it all into the object textures, but my hack felt like the best balance and easiest to modify later.