Lightmapping
Note: currently, the lightmapping does not support Apple M1 (Silicon) architecture devices, and is expected to be supported in v3.1.
The baking system is the process of finally generating light maps and applying them in the scene by calculating the influence of all light sources on the object in the engine scene. The purpose of this system is to reduce the calculation of real-time light sources, thereby improving the efficiency of the scene.
Lightmap panel
The baking process is to calculate the generated results according to the parameters set on the panel, as shown below:
The following table describes the specific meaning of each parameter:
Parameter | Description |
---|---|
MSAA | Multisampling. Has the following values: 1, 2, 4, 8 |
Resolution | Baking map size. Has the following values: 128, 256, 512, 1024, 2048 |
Gamma | Gamma correction value |
GIScale | Global illumination scaling factor |
GISamples | Global illumination sampling coefficient |
AOLevel | AO Level |
AOStrength | AO Strength |
AORadius | AO Radius |
AOColor | AO Color |
Baking the lightmaps
The following three steps are required to turn on the baking system:
Click the menu button in the top menu bar
Project
, click theLightmap
button in the pop-up menu bar to pop up the Lightmap panel.Before baking, you need to set
bakeable
totrue
in the static light attribute of the light source component in the editor.Note: currently only one main direction light source is supported.
- EditorOnly: When checked, only takes effect in the editor
- Bakeable: When checked, enable bake static lighting
- CastShadow: When checked, enable cast static shadow
Set the lightmap properties of the
MeshRenderer
component.- Bakeable: When checked, enable bake lighting
- CastShadow: When checked, enable cast static shadow
- ReceiveShadow: When checked, enable receive static shadow
- LightmapSize: Lightmap size of the model
In the lightmap panel that pops up, after setting the corresponding parameters, click the
Lightmap Generate
button and select the corresponding storage folder to generate the lightmap.Note: the storage folder must be under
assets
.
Using
During the process of generating baked maps, there will be a generated progress prompt. After the generation, you can view it in the Baked
tab in the lightmap
panel.
Baked result (baked result display panel)
shows the lightmap texture after baking, format is RGBE8.Lightmap clear (clear button)
can delete the generated result of bakinginformation output panel
shows the information of each baked image (file name, size, etc.).
Notes:
- when artists create model resources, they need to include an additional set of UV for the lightmapping, in addition to the UV for the model itself.
The model’s material needs to enable the USE LIGHTMAP rendering option: