Search Unity

Hair shadows on head

Discussion in 'Shaders' started by Harrison_Hough, Feb 26, 2017.

  1. Harrison_Hough

    Harrison_Hough

    Joined:
    Dec 3, 2015
    Posts:
    43
    Hey guys,

    I'm wondering if its possible/how to go about getting hair shadows on the face. We have created planar hair and while it does create shadows as a whole object it doesn't create shadows on objects inside of the hair or self shadows either. The hair is one single mesh thats separate from the body mesh.

    I'm assuming the problem is that perhaps it can only shadow things as a whole object. So when something is on the inside of it (like the head) it doesnt shadow that because only part of the mesh would be casting shadows.
    Has anybody ever encountered this problem and thought of a way around it?
    Is it something you can code into the shader or would the only option be to bake a shadow map on the face?

    I have included some pictures to show what I mean. In the last One I move the hair away from the face to show that it does fast shadows on the face then but as a whole mesh if that makes sense. In the other two it doesnt cast any shadows on the face

    cheers!
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Since the face isn't casting shadows on itself either I suspect your light's bias is too high.
     
  3. Harrison_Hough

    Harrison_Hough

    Joined:
    Dec 3, 2015
    Posts:
    43
    Right I totally forgot about that. It seems if i put the bias to something super low like 0.0001 it starts to shadow. Is it bad to have the bias that low?