Search Unity

Add shadow catching to DepthMask material?

Discussion in 'Vuforia' started by jseagull, Aug 21, 2018.

  1. jseagull

    jseagull

    Joined:
    Aug 20, 2018
    Posts:
    5
    I want to add capability to the DepthMask material that ships with Vuforia to catch shadows from augmentations in a way that works on Android. This seems like a straightforward thing to want, but all the resources I've found are years old and none of them seem to work on my Android device (although some shadow-catcher shaders that don't do depth masking work in the Unity Game Viewport).

    The solution that looks right to me is to remove the
    Lighting Off
    line from DepthMask.shader, and add an additional pass to handle the shadows. Since I haven't yet found a shadow-catcher shader that works on Android, however, I don't know what that pass might look like.

    A couple of notes
    • I'm not looking to catch a shadow on a plane - I'm augmenting a model target and my shadow/depthmask shader is assigned to an alternate instance of the same mesh as my model target.
    • I need to be able to move the sun light and to get accurate shadows, so blob shadow solutions aren't workable.
    Has anyone come across a solution to this?