- Home /
How Can I Make a Large Flat Surface Lit By Many Lights?
I have a scene for which I want a very large, flat, untextured surface. This is trivially easy to accomplish in a number of ways, but unfortunately my scene is lit by a large number of small lights (streetlamps, in fact). This is a problem, because only a small number of lights can illuminate a single mesh. Turning the quality up increases the count a bit, but I have something like 30 lights so it's not enough. Their range is short enough that only 1-3 will illuminate any given pixel, but that doesn't help.
I tried chopping the flat surface up into a grid of distinct objects, but that doesn't work either because I need the surface to remain smooth. Chopping it up like this creates visible seams.
How should I make large, flat surfaces to avoid lighting problems? Or is it simply impossible?
Answer by DaveA · Jan 24, 2011 at 06:02 PM
Look into light baking (unless all those lights need to be dynamic): http://unity3d.com/support/documentation/Manual/Lightmapping.html
Answer by Eric5h5 · Jan 24, 2011 at 05:30 PM
There is no limit on the number of lights that will illuminate a single mesh. (At least for pixel lights; the limit is 8 for vertex lights.) Increase the max number of pixel lights in the quality settings.
This works, but seems to cause performance problems once I get to very high light counts. Which I guess isn't too surprising!
If you need dynamic lighting with many small lights, deferred rendering (Pro only) will speed things up quite a bit.
Answer by Helkus · Jan 24, 2011 at 06:14 PM
Were you chopping it up via code or the editor? If you're using the editor, you may get better results if you spawn the smaller plane objects with script and position them exactly where they should be
$$anonymous$$akes sense, but I was already using a script. (I think part of the problem was that the objects were cuboid, not actual planes, so the hidden edges were causing the seams.)