Search Unity

Invisible Ink Shader

Discussion in 'Shaders' started by KamiKaze425, Mar 9, 2017.

  1. KamiKaze425

    KamiKaze425

    Joined:
    Nov 20, 2012
    Posts:
    207
    Hey guys,

    So I've tried searching around, and the closest thing I can find is from this post a while back:
    https://forum.unity3d.com/threads/reveal-texture-only-when-light-falls-on-it.26639/

    The lighting only shader is on the right track. Except I would like shadows (or objects in general), to be able to block it.
    Currently I have a stationary light pointing at the object, but the light is blocked by a circle. The circle splits in half, and the two halves slide in opposite directions, revealing the symbols as it opens. The problem is that the light still hits the material using LightingOnly even though it is blocked by shadows.

    Is there a modification to the LightingOnly shader that will consider being hit by a shadow "not lit"?
    Thanks!