Search Unity

Real time shadowing with spotlights?

Discussion in 'Shaders' started by Anonymous Gamer, Nov 25, 2014.

  1. Anonymous Gamer

    Anonymous Gamer

    Joined:
    Nov 25, 2014
    Posts:
    4
    Long story short, is it possible to cast real time shadows with the spotlight in Unity Pro? For example, if a spotlight is shot at a cube and the spotlight was then moved around, is it possible to render out a shadow on the cube/object?
     
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Yes. If you're using Unity Pro, and having trouble getting this to work, make sure:

    • Your light is set to cast realtime shadows
    • Your player's Rendering Path is set to Forward or Deferred
    • If your rendering path is Forward, all your shaders need the fullforwardshadows directive, and you probably need to set your pixel light count to more than one.
     
  3. Anonymous Gamer

    Anonymous Gamer

    Joined:
    Nov 25, 2014
    Posts:
    4
    Hey thanks man, I figured it out!