Search Unity

Shadows on sprite-diffuse material

Discussion in 'Shaders' started by raycosantana, Sep 27, 2014.

  1. raycosantana

    raycosantana

    Joined:
    Dec 23, 2012
    Posts:
    319
    I know sprites are not meant to have shadows but what Im making requires shadows, the game uses sprites but its not 2D, its pseudo 2D (its in 3D with the sprites layered at different heights), basically what I want to do is give the sprites a "construction paper" effect to them so they look like layered paper cut-outs using a perspective camera instead of Orthographic but for this to work the sprites need to cast shadows like actual paper cut-outs would.

    I seen videos of people who modified the sprite material to cast shadows so I know this is possible somehow...

    Here is one of the videos where I saw sprites casting shadows.


    How can this be done?

    Thanks in advance.
     
    Last edited: Sep 27, 2014
  2. raycosantana

    raycosantana

    Joined:
    Dec 23, 2012
    Posts:
    319
    Nevermind I just found out you could just use
    renderer.castShadows = true;
    and
    renderer.receiveShadows = true;
    with the version of the Sprite-Diffuse shader that has fallback to make them cast and receive shadows.