для этой страницы,
отображается код на другом
Bake Lighting Tool
Bake Lighting is a tool for baking indirect lighting from light sources in static mode. It is used to:
- Calculate static voxel lighting inside Voxel Probes and put it into generated 3D lighting maps.
- Calculate reflection cubemaps for Environment Probes in static mode.
Bake Lighting tool provides a great way to improve the lighting in your scene by allowing dropping the most of lighting computations to maintain high performance at runtime.
- Also light baking is available from the code by using the BakeLighting Class.
Light Baking is the way of precomputing and storing data that describes how the light rays bounce around static geometry causing indirect lighting. Including indirect lighting in modelling helps to significantly improve the realistic look of your worlds.
The following comparison shows the use of different lighting in the scene containing two light sources: a red OmniLight and a WorldLight (with the Sun Shafts camera effect enabled). The left image contains the scene illuminated with direct light only, so unlit areas appear as silhouettes, the large number of details is hidden in darkness.
The right image shows the scene with both direct and indirect light which makes it look way more realistic and connected.
The computation of indirect lighting is a very expensive task for processing unit, so it is usually performed once at the development stage (lighting is baked) and the results are used later for static lighting at runtime.
In terms of UNIGINE light baking is available if there is at least one voxel or non-dynamic environment probe in the scene. To get the lighting baked, perform the following steps:
Prepare the scene: set up lighting and emissive geometry, choose the lights baking mode, hide or exclude unnecessary and dynamic objects from calculations via masking.
Create and place voxel probes at the places where the lighting remains relatively static (e.g. interiors, outdoor buildings and stationary objects).
Place voxel probes inside other ones to create insets defining the areas that require higher detail. Note, that voxel probes with 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.
- Adjust the Baking Settings of probes and the settings of the Bake Lighting tool.
Click Start to begin light baking and wait for the process to complete.
On this stage the Bake Lighting tool performs the following:
You can stop the process any time, the achieved result will be maintained.
- For each enabled Environment Probe a cubemap is grabbed from the center point of the probe depending on its parameters.
- For each enabled Voxel Probe a cycle over all the voxels is performed in order to grab a lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.
Enable post and camera effects.
Bake Lighting Settings
Bake Lighting Settings
|Number of Bounces||Number of light ray bounces.|
|Voxel Size Multiplier||Multiplier for the Voxel Size parameter for each voxel probe.|
|Voxels per Frame||Number of voxels computed and visualized per single frame.
The parameter is available for changing during the light baking process. Higher values cause longer user interface response but accelerate the calculations.
|Light Probe||Progress of light baking for the current probe at the moment.|
|Bounce||Progress of calculating current bounce.|
|Overall||Overall progress of light baking for all the voxel and environment probes in the scene.|