Search Unity

Light passing through mesh at seams

Discussion in 'Global Illumination' started by Hallur90, Mar 8, 2019.

  1. Hallur90

    Hallur90

    Joined:
    Dec 4, 2017
    Posts:
    34
    I bought these cliff sides off the asset store.
    It seems that light passes through the mesh at the seams or sharp angles.

    front.png back.png
    I adjusted the Normal bias in the shadow settings of the directional light and they disappear. That introduces some other artifact elsewhere though.

    Before I contact the seller I just want to ask if there are some light settings I should be looking into.

    Edit: Might have posted this in the wrong subforum, sorry.
     
    Last edited: Mar 8, 2019
  2. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    127
    I have this problem a lot, and it doesn't seem to have anything to do with the geometry of the model. The only way I can fix it is to set resolution to "Very High Resolution" for the directional light, and then set bias and normal bias to zero.
     
    Hallur90 likes this.
  3. Hallur90

    Hallur90

    Joined:
    Dec 4, 2017
    Posts:
    34
    Thanks for the response Jason.
    Have you tried any hacky methods like putting geometry inside of the models?
     
  4. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    127
    Not yet :). Actually I would strongly recommend that you avoid that.

    It seems to be the edge of the shadow map that causes it, so fixing the quality and shadow map fixes it. I just found another way to prevent it. Edit > Project Settings > Quality > Ultra. And if you want even more, you can edit Ultra by altering some of the shadow parameters. For example, if you set "Shadow Projection" to "Close Fit", the problem disappears and you can keep your lower quality settings.

    I'm not experience with lighting so I'm not sure which is the best way to approach this or what performance implications any of these settings will have later.
     
    Last edited: Mar 9, 2019
    Hallur90 likes this.
  5. Hallur90

    Hallur90

    Joined:
    Dec 4, 2017
    Posts:
    34
    Thanks again, I tried your advice just now and the gaps do appear smaller but they are not gone completely.
    Only way to make them fully go away is the normal bias. Problem is it makes my surrounding terrain look weird :(
     
  6. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    127
    I read how setting Bias to 0 can cause artefacts called "Shadow Acne". I guess you have to find a compromise. I was able to set the bias to 0.03 without seeing in cracks in the shadows. 0.04 made a very small crack; noticeable but acceptable. So try that, with high quality settings, high resolution settings and "close fit" and see if it fixes it. Other than that i don't know, because I don't get the acne problem. Let us know if you find a solution.
     
    Hallur90 likes this.
  7. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    410
    The simplest solution to this problem would be to select the mesh, and in the Cast Shadows dropdown, enable Double Sided shadows. The issue should then go away.
     
    Hallur90 likes this.
  8. Hallur90

    Hallur90

    Joined:
    Dec 4, 2017
    Posts:
    34
    Thank you! It werks :D

    Out of curiosity, is there a significant performance hit by using two sided shadows?
     
  9. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    410
    The performance hit should be negligible, as all shadowmap calculations are done on the GPU.
     
    Hallur90 likes this.
unityunity