Bake Lighting窗口
Bake Lighting is a tool that incorporates all light baking tasks. It is used for the following operations:Bake Lighting是包含所有轻度烘焙任务的工具。它用于以下操作:
- Calculate and bake global illumination into lightmaps assigned to surfaces.计算全局照明并将其烘焙到分配给曲面的光照贴图中。
- Calculate static voxel-based GI and put it into generated voxel lighting maps.计算静态基于体素的GI ,并将其放入生成的体素光照贴图中。
- Calculate reflection cubemaps and cutout depth textures for Environment Probes in static mode.在静态模式下计算Environment Probes的反射立方体贴图和切口深度纹理。
- Calculate shadow maps for light sources in static mode.在静态模式下为光源计算阴影贴图。
The Bake Lighting tool enables you to improve performance by dropping the most of light and shadow computations.Bake Lighting工具使您可以通过减少大部分的光影计算来提高性能。
See Also也可以看看#
- Light baking is available via code by using the BakeLighting Class.通过使用 BakeLighting 类,可以通过代码进行轻度烘焙。
- Video Tutorial: Global Illumination.视频教程:全局照明。
Workflow工作流程#
Basically, light baking is available if there is at least one of the following entities is in the scene:基本上,如果场景中存在以下至少一个实体,则可以进行轻度烘烤:
- Voxel Probe
- Environment Probe in Static mode with Grab by Bake Lighting enabled.启用了Grab by Bake Lighting的Static模式下的Environment Probe。
- Mesh Static with at least one surface that has Lightmaps enabled and the Bake Unique Texture mode selected.Mesh Static,至少一个表面启用了Lightmaps且处于Bake Unique Texture模式。
- Light source in Static mode.Static模式下的光源。
To get the lighting baked, perform the following steps:要烘烤照明,请执行以下步骤:
- Prepare the scene: set up lighting and emissive geometry, select the Light Baking Mode and Lighting Modes for surfaces, hide or exclude unnecessary and dynamic objects from calculations via masking and/or adjusting surface flags, enable Lightmaps and select the Lightmaps Mode for surfaces of Mesh Static objects intended to be lightmapped.
准备场景:设置照明和发光几何体,选择灯光烘焙模式,通过遮罩和/或调整表面来隐藏或排除计算中不必要和动态的对象标志,启用光照贴图,然后为要进行光照贴图的网格静态对象的表面选择 光照贴图模式 。
- Create and place voxel probes at the places where the lighting remains relatively static (e.g. interiors, outdoor buildings, and immovable objects). Select Half or Full Bake Internal Volume mode for voxel probes to illuminate dynamic objects that move within their volume.
Place voxel probes inside other voxel probes to create insets defining the areas that require higher detail. Note that voxel probes with the additive blending mode enabled cannot be used for this purpose, as they are blended instead of replacing each other.在灯光保持相对静止的地方(例如室内,室外建筑物和不动的物体)创建并放置体素探针。为体素探针选择半或全 “烘焙内部体积” 模式,以照亮在其体积内移动的动态对象。( br)Place voxel probes inside other voxel probes to create insets defining the areas that require higher detail. Note that voxel probes with the additive blending mode enabled cannot be used for this purpose, as they are blended instead of replacing each other.Place voxel probes inside other voxel probes to create insets defining the areas that require higher detail. Note that voxel probes with the additive blending mode enabled cannot be used for this purpose, as they are blended instead of replacing each other.
Place voxel probes inside other voxel probes to create insets defining the areas that require higher detail. Note that voxel probes with the additive blending mode enabled cannot be used for this purpose, as they are blended instead of replacing each other.将体素探针放置在其他体素探针内部,以创建定义需要更高细节的区域的插图。请注意,启用了添加剂混合模式的体素探针不能用于此目的,因为它们被混合而不是彼此替换。 - Create non-dynamic environment probes and cover the areas which require appropriate reflections on reflective materials.
Disable the Grab by Bake Lighting parameter for probes, the cubemap texture of which should not be modified by the Bake Lighting tool. This is applicable for cases when you do not want to modify your assets.创建非动态环境探针,并覆盖需要在反射材料上进行适当反射的区域。Disable the Grab by Bake Lighting parameter for probes, the cubemap texture of which should not be modified by the Bake Lighting tool. This is applicable for cases when you do not want to modify your assets.Disable the Grab by Bake Lighting parameter for probes, the cubemap texture of which should not be modified by the Bake Lighting tool. This is applicable for cases when you do not want to modify your assets.
Disable the Grab by Bake Lighting parameter for probes, the cubemap texture of which should not be modified by the Bake Lighting tool. This is applicable for cases when you do not want to modify your assets.禁用探针的通过烘焙照明抓取参数,该立方体贴图纹理不应由烘焙照明工具修改。这适用于您不想修改资产的情况。 - Adjust the Baking Settings of probes and the settings of the Bake Lighting tool.调整探针的Baking Settings和settings of the Bake Lighting tool.
- Click Bake to begin light baking for all enabled objects and light sources (or Bake selected lights to affect only selected objects and light sources) and wait for the process to complete. You can also click Bake All Lighting in the right corner of the top toolbar.
At this stage, the Bake Lighting tool performs the following:At this stage, the Bake Lighting tool performs the following:
- For each enabled Omni and Projected light source in the Static mode the shadow map is grabbed and saved in the Depth Texture asset.For each enabled Omni and Projected light source in the Static mode the shadow map is grabbed and saved in the Depth Texture asset.
- For each enabled World light source in the Static Shadow Cascade mode the shadow map is grabbed and saved in the Depth Texture asset.For each enabled World light source in the Static Shadow Cascade mode the shadow map is grabbed and saved in the Depth Texture asset.
- For each Mesh Static surface with Lightmaps enabled and Bake Unique Texture mode selected, lighting is baked into a lightmap texture.For each Mesh Static surface with Lightmaps enabled and Bake Unique Texture mode selected, lighting is baked into a lightmap texture.
- For each enabled Environment Probe, a cubemap is grabbed from the center point of the probe depending on its parameters. If the environment probe has the Cutout By Shadow option enabled, a depth texture is grabbed for the probe as well.For each enabled Environment Probe, a cubemap is grabbed from the center point of the probe depending on its parameters. If the environment probe has the Cutout By Shadow option enabled, a depth texture is grabbed for the probe as well.
- For each enabled Voxel Probe, a cycle over all the voxels is performed in order to grab lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.For each enabled Voxel Probe, a cycle over all the voxels is performed in order to grab lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.
All generated textures will be saved to the bake_lighting folder of your data project's folder.All generated textures will be saved to the bake_lighting folder of your data project's folder.
At this stage, the Bake Lighting tool performs the following:For each enabled Omni and Projected light source in the Static mode the shadow map is grabbed and saved in the Depth Texture asset.For each enabled World light source in the Static Shadow Cascade mode the shadow map is grabbed and saved in the Depth Texture asset.For each Mesh Static surface with Lightmaps enabled and Bake Unique Texture mode selected, lighting is baked into a lightmap texture.For each enabled Environment Probe, a cubemap is grabbed from the center point of the probe depending on its parameters. If the environment probe has the Cutout By Shadow option enabled, a depth texture is grabbed for the probe as well.For each enabled Voxel Probe, a cycle over all the voxels is performed in order to grab lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.All generated textures will be saved to the bake_lighting folder of your data project's folder.You can stop the process at any moment and you will be prompted to keep the achieved result or restore the previous textures.单击Bake以开始对所有启用的对象和光源进行光烘焙(或单击Bake selected lights以仅影响选定的对象和光源),并等待该过程完成。You can stop the process at any moment and you will be prompted to keep the achieved result or restore the previous textures.You can stop the process at any moment and you will be prompted to keep the achieved result or restore the previous textures.At this stage, the Bake Lighting tool performs the following:在此阶段,“烘焙照明”工具执行以下操作:
- For each enabled Omni and Projected light source in the Static mode the shadow map is grabbed and saved in the Depth Texture asset.对于在Omni和Projected静态模式下的光源模式下启用的每个阴影贴图被抓取 并将其保存在Depth Texture资产中。
- For each enabled World light source in the Static Shadow Cascade mode the shadow map is grabbed and saved in the Depth Texture asset.对于每个在Static Shadow Cascade模式下启用的World光源,都会抓取阴影贴图并将其保存在Depth Texture资产中。
- For each Mesh Static surface with Lightmaps enabled and Bake Unique Texture mode selected, lighting is baked into a lightmap texture.对于每个启用了Mesh Static选择了烘烤唯一纹理模式烘烤唯一纹理模式的曲面的lightmap texture。
- For each enabled Environment Probe, a cubemap is grabbed from the center point of the probe depending on its parameters. If the environment probe has the Cutout By Shadow option enabled, a depth texture is grabbed for the probe as well.对于每个启用的Environment Probe ,根据其参数从探针的中心点抓取一个立方体贴图。如果环境探针启用了Cutout By Shadow选项,则也会为该探针获取深度纹理。
- For each enabled Voxel Probe, a cycle over all the voxels is performed in order to grab lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.对于每个启用的Voxel Probe,将执行所有体素上的循环,以从体素的6个面中获取照明并将其附加到生成的3D照明贴图上。
All generated textures will be saved to the bake_lighting folder of your data project's folder.所有生成的纹理将保存到数据项目文件夹的bake_lighting文件夹中。
You can stop the process at any moment and you will be prompted to keep the achieved result or restore the previous textures.您可以随时停止该过程,并且将提示您保持所获得的结果或恢复以前的纹理。 - Enable post and camera effects.
启用发布和相机效果。
Bake Lighting Settings烘烤照明设置#
Bake Static Shadows For LightsBake Static Shadows For Lights#
Bake Static Shadows For Lights | Enable baking of cached shadows for static light sources.为静态光源启用缓存阴影的烘焙。 |
---|---|
Automatic Rebake | Enable auto-rebake of shadows on transforming a static light source or changing its parameters.在转换静态光源或更改其参数时启用阴影的自动重烤。 |
Bake Lightmaps For SurfacesBake Lightmaps For Surfaces#
Bake Lightmaps For Surfaces | Enable baking of lightmaps for surfaces.启用表面的光照贴图的烘焙。 |
---|---|
Baking Viewport Masks | For the light or surface to contribute to static GI, their viewport masks should match the Baking Viewport Mask.为了使光线或表面有助于静态GI,其视口蒙版应与Baking Viewport Mask相匹配。 |
Quality | Baking quality preset.烘焙质量预设。 |
Far Clipping | Far clipping distance for light rays.光线的远剪切距离。 |
Bake Voxel ProbesBake Voxel Probes#
Bake Voxel Probes | Enable baking of voxel-based GI to voxel probes.启用基于体素的GI 到体素探针的烘焙。 |
---|---|
Voxel Size Multiplier | Multiplier for the Voxel Size parameter for each voxel probe.每个体素探针的Voxel Size参数的乘数。 |
Bake Environment ProbesBake Environment Probes#
Bake Environment Probes | Enable baking of reflection cubemaps to environment probes.启用将反射立方体贴图烘焙到环境探针的功能。 |
---|---|
Automatic Rebake | Enable auto-rebake of the cubemap of an Environment Probe on transforming it or changing its parameters.在转换Environment Probe或更改其参数时启用自动重烤 |
Common SettingsCommon Settings#
Number of Bounces | Number of light ray bounces.光线反弹的次数。 |
---|---|
Samples per Frame | Number of sampling units processed and visualized simultaneously each frame (samples for lightmaps and voxels for Voxel Probes):
The parameter is available for changing during the baking process. Higher values cause longer user interface response but accelerate the calculations.The parameter is available for changing during the baking process. Higher values cause longer user interface response but accelerate the calculations.
The parameter is available for changing during the baking process. Higher values cause longer user interface response but accelerate the calculations.该参数可在烘焙过程中更改。较高的值会导致较长的用户界面响应,但会加快计算速度。 |
Progress Bars进度条#
Node/Surface | Progress of light baking for the current node/surface at the moment.目前,当前节点/曲面的光烘焙进度。 |
---|---|
Bounce | Progress of calculating the current bounce.计算当前反弹的进度。 |
Overall | Overall progress of light baking for all nodes in the scene.场景中所有节点的光烘焙的总体进度。 |
Buttons纽扣#
Bake Selected | Starts baking for the selected static lights, probes and lightmapped surfaces regardless of whether they are enabled or not.开始烘焙选定的静态灯,探针和光照贴图表面,无论它们是否启用。 |
---|---|
Bake/Stop | Starts baking for all enabled static lights, probes and lightmapped surfaces in the scene.开始烘焙场景中所有启用了 的静态灯,探测器和光照贴图的表面。 |