Version: Unity 6.2 Alpha (6000.2)
Language : English
Baking lightmaps before runtime
Set up your scene and lights for baking

Introduction to lightmaps and baking

Lightmapping is the process of pre-calculating the brightness of surfaces in a SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
, and storing the result in a Texture called a lightmapA pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary
for later use.

Left: A simple lightmapped scene. Right: The lightmap Texture generated by Unity. Note how both shadow and light information is captured.
Left: A simple lightmapped scene. Right: The lightmap Texture generated by Unity. Note how both shadow and light information is captured.

Lightmaps can include both direct and indirect light. This lighting texture can be used together with surface information like color (albedo) and relief (normals) by the ShaderA program that runs on the GPU. More info
See in Glossary
associated with an object’s material.

The data baked into lightmaps cannot change at runtime. Real-time lights can be overlaid and used additively on top of a lightmapped scene, but cannot interactively change the lightmaps themselves.

With this approach, we trade the ability to move our lights at gameplay for a potential increase in performance, suiting less powerful hardware such as mobile platforms.

Unity bakes lightmaps with the Progressive Lightmapper.

For advice on setting up a lightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
See in Glossary
, see Lightmapping: Getting started.

The Progressive Lightmapper

The Progressive Lightmapper is a fast path-tracing-based lightmapper system that provides baked lightmaps and Light ProbesLight probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary
with progressive updates in the Editor. It requires non-overlapping UVs with small area and angle errors, and sufficient padding between the charts.

The Progressive Lightmapper takes a short preparation step to process geometry and instance updates, and generates the G-buffer and chart masks. It then produces the output immediately and progressively refines it over time for a much-improved interactive lighting workflow. Additionally, baking times are much more predictable because the Progressive Lightmapper provides an estimated time while it bakes.

The Progressive Lightmapper also bakes global illuminationA group of techniques that model both direct and indirect lighting to provide realistic lighting results.
See in Glossary
(GI) at the lightmap resolution for each texel individually, without upsampling schemes or relying on any irradiance caches or other global data structures. This makes it robust and allows you to bake selected portions of lightmaps, which makes it faster for you to test and iterate on your Scene.

For an in-depth video showing the interactive workflow, see Unity’s video walkthrough: In Development - Progressive Lightmapper (YouTube).

Baking lightmaps before runtime
Set up your scene and lights for baking
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961