Documentation for lighting in UDK:
Remember to read the official documentation in addition to this document. The official documentation goes into a lot of detail on the specifics.
An Overview Of Lightmass
The system that builds lighting in UDK is called "lightmass". UDK, using lightmass, actually needs to handle at least two distint types of lighting:
During gameplay, both static and dynamic lighting are combined. Note that a single object may use some combination of static lighting and dynamic lighting at the same time. (Indirect lighting may be baked in a lightmap, but direct lighting may be dynamic to account for players and objects moving in front of the light source.)
For best performance, artists should try to use static lighting on as many objects as possible.
Dynamic lighting is generally lower quality than static lighting, because high quality dynamic lighting is extroardinarily hard to computer. (Think of how long mental ray takes to render a frame, compared to UDK rendering 60 frames every second.)
It's worth nothing that the UDK lightmass system is a full global illumination type system, visually similar to baking final gather lighting in Maya. The lightmass system also support creating ambient occlusion in the lightbaking process. Also, the post process system does some minor screen space ambient occlusion, glows, and color correction.
For the reason's above, lightmap baking in Maya is not always required, though sometimes in can help get a better look. What is required is for most objects to have *really good* lightmap channel uvs. Alternatively vertex colors or dynamic lighting environments can be used.
Generally, for dynamic objects, UDK light environments are used. UDK bakes the lighting at various points in space into "light environment" objects, which can be attached to dynamic objects in the final level, and which do a lot of calculations to get the lightmass global illumination into "spherical harmonics" (complex math based storage of lighting) that can be applied to moving objects.
Most parts of most scenes will just be static models with static lightmaps.
Any lightmapping on objects done outside of UDK is essentially just "extra" lightmapping. Normally, the build process in lighting computes all the lightmaps for the player. UDK just needs good UVs on the models to support the lightmaps that are created by UDK. Often it is useful to bake some additional lightmapping into the object (AO etc) however, UDK is actually able to do most of it itself.
In particular, any lights baked prior to coming into UDK should be as generic as possible, since the objects will likely be moved around and duplicated in UDK. For example, do not bake a spotlight shining a bright spot onto a part of an object using your 3d authoring package. In general you should not bake directional shadows in your 3d authoring package either.
If color variation isn't required in the baked lighting, then it's good to put the baked lighting info into a single channel of an image. (As opposed to wasting 24bits per pixel.) Either the alpha channel of one of the regular textures can be used, or one of the RGB channels on a texture can get used, with the other channels being used for other mapped properties.
To Use Lightmass In Your Scene
A lightmass importance volume is crucial to have when using the lightmass system. The lightmass importance volume tells UDK where it needs to focus on getting good lighting quality. All the important parts of your scene, other than background elements (such as your skybox and distant scenery) should be within the lightmass importance volume.
Each scene should have exactly one lightmass importance volume. It should just be a box. UDK doesn't currently (as of March 2012) support other shapes for lightmass important volumes, nor does it support multiples. If you use another shape it will use the bounding box anyway.
The Light Source Radius Option
Most lights have an option for the light source radius. It only affects lightmass static lighting.
The light source radius controls how big the area emitting light is. (The size of the lightbulb.) It is represented by a yellow circle. It has a strong effect on the shadow sharpness for static lighting. Large numbers cause very soft shadows. Keep in mind that small numbers will cause the shadows to look more like the sharper shadows created by dynamic lights.
Be careful not to have the light source so large that it intersections with other geometry that casts shadows. That would mean that half the light sources was behind a shadow caster, and the lighting would look very strange.
In the viewport menu, you can use: show > advanced > light radius to toggle display of the light radius.
Lightmap Based Lighting
Lightmass generates lightmaps for most static lighting in your scene. Lightmaps are texture maps that the computer generates based on the lights that you place in your scene. When you push "build lighting" lightmass regenerates the lightmaps, as well as any vertex color based lighting. (Explained in the next section.)
By default, lightmaps use the second UV channel/set, which has the index "1". Remember that the first UV channel/set has index "0". Most of the time, UV[0] is used for regular texture mapping, and UV[1] is used for lightmapping.
Larger lightmap resolutions will cause build time to go up a lot. (Whenever you use "build all" or "build lighting" the computer will spend a long time calculating the lighting.
Vertex Color Based Lighting
Objects that have a lightmap resolution of zero will use vertex lighting instead of lightmaps, however, vertex lighting only works well when the objects has a lot of verts, and they are spread evenly.
To use vertex color based lighting, simply set the lightmap resolution to zero on any object, either in the static mesh editor, or on on the properties of the individual instance in your scene.
Controlling Lightmaps Quality On CSG/BSP Geometry
The default lightmap size on bsp geometry is very low quality. You will likely want to turn it up significantly.
Select BSP surfaces, press F5 for the surface properties. Change the lightmap resolution.
Smaller numbers, give higher quality lightmap resolution. Note that this is the opposite of how the resolution is controlled on other objects (where higher resolution means better quality). Thus, for CGS/BSP geometry, turn the resolution down here for better quality. Turn it up to improve lighting speed, and use less RAM for textures.
A setting of "4" looks great for important surfaces. Farther away surfaces and less important ones can use the default settings.
Controlling Lightmap Quality For Most Objects
Every static mesh has settings for the lightmap resolution. The default lightmap size is extremely low. It will cause artifacts on most meshes.
A resolution of 128 works well on most objects, if you can afford the time when building/lighting your scene. Values of 512 and beyond start causing extreme slowdown in the build system. Very few objects should require lightmaps of such high sizes. If your lightmap needs to be that big, consider breaking your model up into smaller pieces.
For static mesh lighting, there are two main methods of controlling the resolution.
A useful strategy is to use fairly low resolutions in the static mesh editor, and then when nearing completion of the lighting in your scene, override those values with larger numbers.
Resolutions To Use For Lightmaps
Here are a couple examples of lightmap resolutions
In general most objects will look good enough with lightmaps of 128 or 256. Resolutions of 512 should be used quite rarely.
What resolutions you use are also largely defined by the platform you are running on. Numbers given in the above examples are for a typical modern PC.
Things To Watch Out For When Using Lightmaps
If you have one giant high poly static mesh (such as an entire house), it will all need to use one lightmap, of a very high resolution. This can be very problematic.
Attempt to split you objects up into modular components that can fit together. A house that the player can walk up to should be made of several wall pieces, window pieces, and other small pieces. A house far away in the background can of course be very low poly and use a small lightmap.
For any objects that are very small and simple or far away from the camera, consider using vertex lighting (a lightmap resolution of zero). In many cases it will look good enough and save texture map memory.
Emmisive Materials with Lightmass
You can cause emmisive materials to actually illuminate the scene using lightmass. You need to turn the option on for each object in the scene that should cast light via it's emmisive texture. Only static objects can be emmisive. It won't work for animated/moving objects.
Static Mesh Actor
Static Mesh Component
Lightmass
Lightmass Settings
Use Emissive For Static Lighting
Note that emmisive lighting can affect dynamic object in a way, since the light environment spherical harmonics do sample the global illumination system. It's not entirely perfect, but it actually works reasonably well.
Controlling The Strength of Lightmass Global Illumination Lighting - Lightmass Boost Values
There are several places where you can change the strength of the lightmass.
The boost settings all multiply with each other. (So if they are all set to "1", the end result is "1", meaning regular intensity of lightmass lighting.)
Places to find boost settings:
World Settings
Actor
Static Mesh Itself
Material
Diffuse Boost is set to 5 in many scenes (and in many default scenes). It is recommended that you start by setting it to a value of 1 and adjust from there. In the World Properties Lightmass settings, check the "Diffuse Boost" and make sure it's not set to 5. Such a high value would cause ultrabright lighting that would be too colorful. (Only useful for really stylized unrealistic lighting.)
Select Some Surfaces and use: RMB > Surfaces > Lighting > Lightmap resolution
Indirect normal influence boost, found in World Properties
When this setting is too high (often anywhere above 0) it can cause artifacts in lightmass, such as dark patches on object lighting. If you are having such a problem, try setting it to zero and using build > build all.
In the notes below, "Dynamic objects" mean any objects that can ever move during gameplay. Doors, elevators, destructables, characters, physics rigidbodies, deforming objects, etc.
All the various light types available can be found in the content browser in the Actor Classes tab. Find lights in the tree and open up that section to find them all.
Before lighting, when first building your level
While Lighting
All of these are just suggestions and starting points. Since every scene is different, you'll need to use different settings for every scene. However, in most scenes, the settings that look the best are similar to what is described above.