Version: 2017.2
Scene 视图中的 GI 可视化
光照贴图参数

Lightmapping Quickstart

This is an introductory description of lightmapping in Unity. For more advanced topics see the in-depth description of lightmapping in Unity

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:

  1. 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.
  2. 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.
  1. 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).
  1. Press Bake
  2. A progress bar appears in Unity Editor’s status bar, in the bottom right corner.
  3. 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!

Lightmapping In-Depth

For more information about the various lightmapping-related settings, please refer to the in-depth description of lightmapping in Unity.

Scene 视图中的 GI 可视化
光照贴图参数
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961