Search Unity

Toon Shader + Real time Shadows

Discussion in 'Editor & General Support' started by Buff, Apr 24, 2012.

  1. Buff

    Buff

    Joined:
    Mar 21, 2008
    Posts:
    131
    Hello,

    I'm trying to make a "toon look" for my models, I use the standard Toon Lighted Outline shader, and I set up a directional light with Hard Shadows ON (I have Unity PRO). Now... there are no shadows casted in my scene! I tried to go back and change my models to use a common Diffuse shader, and... still no shadows! I don't know what I am doing wrong... I've already tried all the things I know of... including the render type (forward, deferred, etc) Any ideas will be greatly appreciated!

    Thanks!
    Nick.
     
  2. MADmarine

    MADmarine

    Joined:
    Aug 31, 2010
    Posts:
    627
    Did your models ever have shadows?

    If you're using any mobile platform, Android or iOS, note that you wont be able to use real time shadows.

    Make sure your shadows have a surface to be cast upon, and that all the models in your scene have receive and cast shadows on in their mesh renderer components.

    Also check your quality settings and make sure shadows are enabled in there, you might also need to increase the shadow distance.
     
  3. Buff

    Buff

    Joined:
    Mar 21, 2008
    Posts:
    131
    Hey MADmarine,

    Thanks for your reply.
    - I'm targeting PC and Browser.
    - I do have a mesh under my models to cast shadows (althought I haven't checked if they are enabled to cast shadow as a mesh... but I'm sure they are because this is standard).
    - As for the quality and shadow distance: Yes I've also played with this values :S

    So... thanks for the help... but I'm still with the same problem here... :(
     
  4. MADmarine

    MADmarine

    Joined:
    Aug 31, 2010
    Posts:
    627
    If you start a completely new project, new scene, get a plane, a cube and a directional light, can you have shadows then?
     
  5. Buff

    Buff

    Joined:
    Mar 21, 2008
    Posts:
    131
    Yes! I already tried that actually... thus I don't know what is the difference between my Toon scene and the other one. I believe that the Toon Shader does something, which later, even after switching back to a Diffuse, will not allow RealTime shadows.
    But... The toon Shader Should be able to cast shadows right? I mean... at the end of the day, its the geometry that is taken into account... ?
     
  6. MADmarine

    MADmarine

    Joined:
    Aug 31, 2010
    Posts:
    627
    Shaders need to be capable of casting and receiving shadows, it's not just the mesh. If you click on the shader in your project view you can see if it supports shadows. You should be able to get shadows back if you assign a different material though...
     
  7. Buff

    Buff

    Joined:
    Mar 21, 2008
    Posts:
    131
    Yes exactly! That's what I was getting stuck at... because I switched back to diffuse and couldn't get my shadows. Anyway... I'll try another approach tonight. If not I'll be back with more questions :p