Search Unity

Point light not casting shadows

Discussion in 'General Graphics' started by Tornado77, Oct 14, 2019.

  1. Tornado77

    Tornado77

    Joined:
    Nov 14, 2018
    Posts:
    83
    Hi, I'm trying to make the solar system in unity and I put a directional light to illuminate the planets but it was not working because the sun illuminate in all directions at the same time so instead I put a point light with very long range but now Saturn is not casting shadow on its rings, is that normal ?
    (With the directional light Saturn was casting its shadow on the rings exactly like on the 2th picture)

     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    Two possible causes. One is that point light shadows are of significantly lower quality than directional shadows. Much worse than spot light shadows too, which they themselves are also much worse than directional shadows. It's possible the shadow quality is just so low that you can't even see the shadow on the rings.

    The other option is if you're using a surface shader, by default they only support shadows from a directional light. You need to add
    fullforwardshadows
    to the
    #pragma surface
    line to add support for point or spot light shadow receiving.
     
  3. Tornado77

    Tornado77

    Joined:
    Nov 14, 2018
    Posts:
    83
    I'm not using surface shader and the shadow quality is set to quality settings
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    Then you may just be hitting the limitations of point light shadows. In general shadows for point lights are much harder than any other type of light, and Unity's point light shadows are some of the worst you'll find. Try putting down a huge plane to shadow cast against. You'll probably see the shadow for your planet start some 5+ planet diameters away, even when intersecting the plane and the bias settings on the light set to 0 (near plane should be set to 10).

    Like this:
    upload_2019-10-14_17-7-42.png
    This is a 500 unit radius point light set to very high resolution shadows, Bias 0, Normal Bias 0, Near Plane 10. The sphere is the default 1 unit sphere unscaled and 200 units away.

    This is as good as Unity's point light shadows get.
     
    Tornado77 and hippocoder like this.
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    Tornado77 likes this.