Search Unity

Opacity change when light hit?

Discussion in 'Shaders' started by milkytreat, Mar 22, 2007.

  1. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    I apologise for not tackling this on my own first i have no idea

    is it possible to change the opacity relevant to how much light is hitting the object?
     
  2. Samantha

    Samantha

    Joined:
    Aug 31, 2005
    Posts:
    609
    I think you could do this one of two ways. Approach 1 would require a custom shader. Approach 2 would require you to get the distance from your object to any lights shining on it, and change the opacity manually based on how close/far it is. This is pretty similar to how much light is shining on the object, but not identical.
     
  3. milkytreat

    milkytreat

    Joined:
    Jan 15, 2007
    Posts:
    267
    In approach 2, the opacity affects the whole object (thats more or less what im doing now)

    I just want to affect the faces that are being shone on
     
  4. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324