Lights and Culling Masks

Hi,

Try as I might with different versions of layers and cameras and lights, i seem to be unable to remove a light source from a given camera. Even when the light and its parent object are in a layer included in the camera culling mask it still seems to show up regardless.

The problem has arisen because I have an FPS character with a head mounted spotlight/torch type thing. Another camera in the scene is used for showing a top down view for miinimap purposes. I don’t want the torch/headlamp thing to show up in the minimap, but I can’t seem to get it to not display.

Any tips or working examples would be gratefully received.

Thanks

solution 1

render with shader that doesn't calculate light at all http://docs.unity3d.com/Documentation/ScriptReference/Camera.RenderWithShader.html

solution 2

use OnPreRender to disable lights right before camera renders. don't forget to enable it after render finishes. http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.OnPreRender.html