I have sort of a survival-horror style game where the lighting is very dark. I have a monster who I would like to be visible through the darkness.
In DirectX or OpenGL, this would be trivial --- I'd just set the ambient light higher before the object is rendered, and set it back to where it was after it's been rendered.
Is there a way to do this in Unity? Are there some kind of prerender/postrender callback functions for a given object that I don't know about?
Use a shader for the monster that adds some extra color value, similar to the built-in VertexLit shader's Emissive Color property.
answered Feb 14 '11 at 12:45 AM
Put the monster on a different layer and have a separate light for the monster
(I think it is cull you change on the light)
answered Feb 14 '11 at 01:28 AM
All the built-in shaders shaders that use lighting multiply the ambient light color by some other color. Despite what is said in the documentation, you're not restricted to 0-1; a Color is just four run-of-the-mill floats. If you need the ambient setting boosted, you can pick something that looks good using the color picker, in the Editor, and multiply all the channels of it by a constant greater than 1.
Unfortunately, as far as I know, the color for ambient and diffuse lighting is tied together in all of the built-in shaders, so I don't know that you can achieve this effect without deep modification. I had a look at some surface shader examples, and it didn't look easy, but I didn't look for very long. ;-)
answered Feb 14 '11 at 01:52 AM