Unity has a fully integrated lightmapper – Beast by Illuminate Labs. This means that Beast will bake lightmaps for your scene based on how your scene is set up within Unity, taking into account meshes, materials, textures and lights. It also means that lightmapping is an integral part of the rendering engine - once your lightmaps are created you don’t need to do anything else, they will be automatically picked up by the objects.
Preparing the scene and baking the lightmaps
Selecting Window –> Lighting from the menu will open the Lightmapping window:
Make sure any mesh you want to be lightmapped has proper UVs for lightmapping. The easiest way is to choose the Generate Lightmap UVs option in mesh import settings.
In the Object pane mark any Mesh Renderer, Skinned Mesh Renderer or Terrain as static – this will tell Unity, that those objects won’t move nor change and they can be lightmapped.
To control the resolution of the lightmaps, go to the Bake pane and adjust the Resolution value. (To have a better understanding on how you spend your lightmap texels, look at the small Lightmap Display window within the Scene View and select Show Resolution).
Press Bake
A progress bar appears in Unity Editor’s status bar, in the bottom right corner.
When baking is done, you can see all the baked lightmaps at the bottom of the Lightmap Editor window.
Scene and game views will update - your scene is now lightmapped!
Tweaking Bake Settings
Final look of your scene depends a lot on your lighting setup and bake settings. Let’s take a look at an example of some basic settings that can improve lighting quality.
This is a basic scene with a couple of cubes and one point light in the centre. The light is casting hard shadows and the effect is quite dull and artificial.
Selecting the light and opening the Object pane of the Lightmapping window exposes Shadow Radius and Shadow Samples properties. Setting Shadow Radius to 1.2, Shadow Samples to 100 and re-baking produces soft shadows with wide penumbra - our image already looks much better.
We can take the scene one step further by enabling Global Illumination and adding a Sky Light. In the Bake pane we set the number of Bounces to 1 and the Sky Light Intensity to 0.5. The result is much softer lighting with subtle diffuse interreflection effects (color bleeding from the green and blue cubes) - much nicer and it’s still only 3 cubes and a light!
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!