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.
  2. Dismiss Notice

Unity 2D Sprite Objects cast shadows?

Discussion in 'Shaders' started by WrongTarget, Dec 6, 2013.

  1. WrongTarget

    WrongTarget

    Joined:
    Nov 18, 2013
    Posts:
    43
    Hi guys :)

    So I'm a game designer experimenting with the 2D tools of Unity 4.3 pro.
    For an idea I have in mind, I want to use Sprites that can take normal maps and cast shadows.
    None of those things seem to be possible out of the pack.
    A friend wrote me a shader for the Sprites and now they are working with normal maps!
    But they still won't cast any shadows using point lights and deferred lighting. Is there a way to enable this?

    Cheers!
     
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Sprites are flat 2d pairs of triangles with no depth. The only way you'd get shadows is if the light is in front of or behind the object and the shadows are projected forwards or backwards, but not sideways. You also might need to add something to the shader to make it work with shadows?
     
  3. WrongTarget

    WrongTarget

    Joined:
    Nov 18, 2013
    Posts:
    43
    Is a 2D point and click adventure game. I'm not sure what you mean imaginaryhuman. How does 2D toolkit sprites achieve this then?
    In this image I have a 2D toolkit sprites on the far left. As you can see the sprite is projecting shadows from the point light. The other two sprites are Unity 2D sprites.
    What could be added? $AIHaRS2.png