Strange lighting effect with three lights

I’m using Unity 4.6.3f1 (free). While trying to create a scene that looks like the view off the back of a flatbed truck driving down a road at night, I encountered some strange light effects that I don’t understand.

To demonstrate the issue I created a [44004-lighttest.zip|44004] and captured a video of said project.

The test project has a pair of spotlights aimed at the ground, one green and one red. There’s also a white point light nearby. The “ground” is a simple white plane, using the default diffuse material.

If I have any two lights on, I get the effect I expect. When I enable a third light, the red spotlight effectively turns into a point light that pulses as the ground moves past it, and flares at the edge of the plane.

I see similar things with my more fully-featured scene. I was able to mitigate the problem by using layers and angling lights to ensure that only two lights are hitting the ground, but when I ran the scene on an Android tablet the problem recurred. Also, in some configurations, I will either see two spotlights or the flashing behavior depending on which part of the plane is under the lights (i.e. one half shows the spots as desired, the other half has the varying-intensity spot behavior).

Why is this happening? How can I work around it?

I believe I can answer my own question (with a little help from a comment on the youtube video).

According to this page, a limited number of lights are rendered at high fidelity. The rest are rendered with a simpler but faster technique. The number of lights is determined by the quality setting.

If you go into Edit > Project Settings > Quality, the “Pixel Light Count” value determines how many lights get the high-quality treatment. Clicking on the different level names (Simple, Good, Beautiful) immediately updates the editor’s scene renderer, and you can see the effects on the test project.

So the ways to work around this are:

  • limit the number of lights striking any given object; or
  • crank up the Pixel Light Count; or
  • set the Render Mode for each of the lights to “Important”.

The PC defaults to Good (2 lights), while Android defaults to Simple (1 light), which explains the difference I saw when running on Android.