|
Hello, 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? Thanks!
(comments are locked)
|
|
Use a shader for the monster that adds some extra color value, similar to the built-in VertexLit shader's Emissive Color property. Thanks for your help! I managed to do it using a shader which calculates the color based on (_Ambient + primary)*texture .
Feb 14 '11 at 03:15 AM
UltimateWalrus 1
(comments are locked)
|
|
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) This is a good idea as well, I'll keep this in mind as I'll probably need to use this later in my game. Thanks!
Feb 14 '11 at 03:16 AM
UltimateWalrus 1
In fact I may very well use this technique, as increasing ambient isn't giving me the exact effect I wanted.
Feb 14 '11 at 03:18 AM
UltimateWalrus 1
(comments are locked)
|
|
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. ;-)
(comments are locked)
|
