Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Why doesn't a spotlight make all objects in its cone cast shadows?

Discussion in 'General Graphics' started by ekergraphics, Jun 16, 2017.

  1. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
  2. UziMonkey

    UziMonkey

    Joined:
    Nov 7, 2012
    Posts:
    206
    It should be casting shadows. Here are some things to check.

    • On the inspector for the light, make sure cast shadows are on. Without it the light won't cast shadows.
    • On the mesh renderer for all objects you want to cast shadows, make sure they're configured to cast shadows.
    • In your quality settings, make sure the shadow distance is large enough to encompass the area you want shadows cast.
    • Make sure (don't laugh, I've done this) the camera is just not at an angle where you can't see the shadows.
    • If you're using baked lighting, make sure you've baked light maps. In the lighting panel press Bake or make sure Auto is checked.
     
  3. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Shadows are on everywhere, and it does cast a shadow, but only at very specific distances between the floor and the spotlight origin.

    I do not use any baking at all, since the entire scene must potentially move.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    11,616
    Try reducing your spot light's near plane.
     
  5. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    That did not work, but increasing it did have a result. Very weird!

    Is there a better way to get directional light type of shadows on other lights than directional? This is a realtime lit indoors scene.
     
unityunity