Search Unity

Baked terrain shadows not being shown accurately

Discussion in 'Global Illumination' started by jeijei, Aug 3, 2019.

  1. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    I've got a terrain with the default terrain standard material, everything is static, my light is mixed, lightmap resolution is as high as possible, ambient color is almost pitch black.
    However after baking the lightmap, the terrain is hardly affected by the darker areas in the lightmap
    in the lightmap where this shelter is supposed to be, you can see it's pretty dark. however ingame it's almost the same color as a regular shadow.
    Am I missing something, or does it just not work the way I think it does?
    I tried making a new material for the terrain with the same shader, but my only options from it are the doublesided GI
     

    Attached Files:

  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    The darkening could be caused by invalidated texels where your geometry intersects the terrain. Similar phenomenon can be seen at the base of the palm trees, to the right of your shack. You can verify this using Texel Validity view after baking (invalid texels will be shown as red).

    If the player will never be able to see the inside of the shack, you shouldn't worry about it. Otherwise, you will have to rely on creating custom lightmap parameter asset for your shack and terrain, and play with the Backface Tolerance value.
     
  3. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    not sure if i made it clear enough, but i want it to be as dark as it is in the lightmap. you are supposed to be able to go inside of the shack, and i'm not understanding why the darkness is essentially missing, even though i can clearly see it in the lightmap
     
  4. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    example - the legacy diffuse gets the lightmap right, the standard shaders hardly show it
     

    Attached Files:

  5. jeijei

    jeijei

    Joined:
    Aug 31, 2014
    Posts:
    30
    with a bit of digging through the default shaders, this is what i sort of came up with - overriding the lighting to always return 1, while the emission is multiplied by the lightmap - and i more or less get the indoor shadows i'm expecting.
    What I don't understand is what in the standard shader is different to cause this
     

    Attached Files: