|
Ie for UV/infrared lights. I already know how to get a particular mesh to be affected only by a specific light, but this can't affect its visibility (just how much it reflects the light). Basically- I want its visibility (alpha) to change, depending on how much light(from a specific source) it has recieved.
(comments are locked)
|
|
I'm fairly new to Unity, so I don't know if this is possible, but could you perhaps render once without the UV light, then make the object visible and render again, this time only using the UV light, and overlay the second image on the first?
(comments are locked)
|
|
You can look at a specular shader for an example. Instead of increasing or decreasing reflection strength, you can increase or decrease alpha strength. You would have to make a map for it, depending on what you want the player to see, weather you want to view the object as a colored heat signature or just as a regular diffuse looking textured object.
(comments are locked)
|
|
I'm sure there is a neat technical way to do this, but I'd just fake it with some triggers. If you want an object to appear near certain lights, fade it in when it is near them and out when it isn't. If you want the player to see them when wearing goggles or something, that's even easier. You can just flip them visible when he/she activates the item. Its slightly more complicated than that. Imagine a first person game where the player moves a infrared torch around the room. Anything within that beam of light needs to show up. In saying that, I could fake it with a long collision box which encompases the light beam and anything in the box alphas in? Sound good enough?
Oct 15 '10 at 01:00 PM
Grimmy
That should work. My first thought was to cast a ray (or four) from your light source every half second or so (no need to do this every frame), and make anything it collides with visible, and anything it doesn't invisible. http://unity3d.com/support/documentation/ScriptReference/Physics.Raycast.html You might try both and see which works better in practice. I can see potential problems with the ray cast idea, such as smaller items popping in and out because they just happen to dodge rays, etc.
Oct 15 '10 at 08:37 PM
Grumblekeen
(comments are locked)
|
