Search Unity

Flash light Shader

Discussion in 'Shaders' started by kirkf, Jun 7, 2013.

  1. kirkf

    kirkf

    Joined:
    Jun 5, 2013
    Posts:
    5
    I'm making a 2D game and would like to implement a shader that works like a flash light.

    So when I move the mouse over an area of the texture that part should be illuminated and the rest of the texture should remain dark, exactly how a flash light would work.

    Can someone suggest the best way to do this, please :)
     
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    The easiest way to do this is with Unity's built-in lighting.
     
  3. Lulucifer

    Lulucifer

    Joined:
    Jul 8, 2012
    Posts:
    358
    Ie, A spot light follows the mouse, I think it is a kind of script trick,not much of shader