Lighting Preset
The Lighting Preset Script is a component used to store lighting data on an Area or Level. This is not a requirement for levels, but is a requirement for Areas so that it can save the area lighting data (like sun direction, sun intensity, fog etc).
To create this: Right click a space in the Project inspector > Create > ThunderRoad > Levels > LightingData
This script does not change all lighting data fields. This means that the data in the Lighting Settings must be applied in the lighting settings rather than changed via this script. This includes:
- Baked Global Illumination (needed for baking)
- Lighting Mode
- Progressive Updates
- Filtering
- Lightmap Resolution
- Lightmap Padding
- Max Lightmap Size
- Lightmap Compression
- Directional Mode
- Albedo Boost
- Lightmap Parameters
Fields
These fields will actively overwrite scene Lighting Settings. Make sure you make a backup of your scene before you apply these settings, incase you don’t want to load your Lighting Settings.
Field | Description |
---|---|
Ambient Intensity | Sets the ambient intensity of the area/scene. |
Shadow Color | Sets the color of realtime shadows. |
Baked Shadow Angle | Changes the Baked Shadow angle, which adds artifical softening to edges of shadows. |
Multiple Importance Sampling Tool | Adjusts the “Multiple Importance Sampling” section of the lightmapper. |
Direct Samples | Sets the “Direct Samples” of the Lightmap Settings |
Indirect Samples | Sets the “Indirect Samples” of the Lightmap Settings |
Environment Samples | Sets the “Environment Samples” of the Lightmap Settings |
Min/Max Bounces | Sets the “Min/Max Bounces” section of the lightmap settings |
Indirect Intensity | Sets the “Indirect Intensity” section of the lightmap settings |
AO Indirect Contribution | Sets the Indirect Contribution section of Ambient Occlusion (will enable AO in baking.) |
AO Direct Contribution | Sets the Direct Contribution section of Ambient Occlusion (will enable AO in baking.) |
Apply At Runtime | When enabled, the directional light and its settings will be applied in game. This is recommended for exterior rooms, so that the directional light meets the baked directional light. If disabled, the realtime light will keep the same data as the previous area loaded. |
Dir Light Color | Will change the colour of the directional light when you enter this area. |
Dir Light Intensity | Will change the intensity of the directional light. |
Dir Light Indirect Multiplier | Will change the indirect multiplier of the directional light |
Directional Light Local Rotation | Will change the direction/rotation transform of the directional light. |
Fog | Will change the fog at runtime. • No Change - Will not change fog from last area. • Disabled - Will Disable Fog. • Enabled - Will Enable Fog and apply the fog settings. |
Fog Color | Will change the fog color. |
Fog Start Distance | Will adjust the distance the fog will appear closest to the player |
Fog End Distance | Will adjust the distance the fog will be at max away from the player |
Skybox | Will change the skybox material runtime. • No Change - Will not change the skybox from the last area. • Disabled - Will Disable Skybox, setting it to black. • Enabled - Will Enable skybox and apply the material. |
Material | When skybox is enabled, the skybox will switch to this material. Through this, you can adjust the shader components of the skybox, being able to change the rotation, colour etc, without overriding the material. |
Clouds | Adjust the clouds located in the Area scene. • No Change - Will not change clouds from last area. • Disabled - Will Disable Clouds. • Enabled - Will Enable clouds and apply the settings. |
Cloud Softness | Will change the softness/hardness of the clouds |
Clouds Speed | Will change the moving speed of the clouds |
Clouds Size | Will adjust the size/tiling of the clouds |
Clouds Alpha | Will adjust the transparency of the clouds |
Clouds Color | Will adjust the colour of the clouds. |
Setup
For the Lighting Preset to apply to meshes, the meshes MUST be a child of the Lighting Preset script. They do not need to specifically be children, but they must be under the Lighting Preset for it to bake correctly.
To get this to apply to an area/scene, they will need a Lighting Group. Add the Lighting Group
script to the area/scene, add the Lighting Preset to it, and then ensure that the Lighting Preset is addressable.
For Dungeon Areas specifically, this object must be at the root, with the AreaLightingGroupLiteMemoryToggle script added.