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
That should do the trick, thanks!
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
Makes 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.)
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
Voxel lighting - apply lightmap to mesh
Unity creates triangles and then lights them up wrong
Generated mesh loses lighting at certain angles
How can I write a custom cutout diffuse shader that supports custom vertex colors?