Environmental Light
This page provides detailed instructions on setting up and configuring environmental lighting in different areas of a map. It covers the creation and assignment of environment areas, as well as the various settings available for fine-tuning the lighting effects.
Environment Areas
Environment areas are used to set up different environments (envs) for different areas of a map. They are commonly used for time of day changes, new sun angles, or different locations in a map.
The Environment Editor is the tool used for editing an Environment Area decl. Become familiar with the interface before creating or editing an env decl.
The Env Settings control the look of an area (see Env Settings below).
Set Up an Environment Area
Step 1: Create Multiple Envs
- Open the Environment Editor from the main window by going to Windows → Editors → Environment Editor.
- For more information on how to adjust env settings to get a desired look, skip ahead to: Env Settings
Step 2: Create an Env Area
- In the World Editor, right-click then select New Entity → Volume → env_area to add an env area to your scene.
- You may need to enable Show Environment Areas in your View Options, which can be opened via the World Editor under Tools → View Options.
- Press F4 to toggle rendering the env volume in your perspective view.
- Use your orthographic views in the World Editor to change the size and shape of the env area; click outside the volume near the edge you want to move, then drag the mouse to change the size of the area.
Step 3: Assign the Env to the Area
- Select the env area, then left-click on the Env Effects Decl attribute in the Entity Inspector.
- This will open a menu where you can navigate to the desired env decl.
Step 4: Rebuild Triggers and Volumes
- Remember to keep the lighting and level design teams informed before you make changes to a map.
- To update the volumes so that they will work in engine and in the editor, go to the Build tab in the World Editor then choose Rebuild Triggers and Volumes.
- You can have many env areas within a map. Generally they should not overlap to ensure that the desired env is being used at any given location.
- The default env of a map can be set by navigating to the top refmap of the map and setting the Env Settings attribute from the Entity Inspector. This will decide what env is used when the player is outside of an env volume.
- Env areas that make large changes to the sun direction or color will require additional setup to make sure that the lightmap and shadow cache matches. For more information in these specific settings, see: Sky Settings.
Environment (Env) Settings
Below is a list of useful Environment Lighting parameters (located inside the Environment Editor).
HDR Rendering
These are controls for adjusting the exposure and color grading.
Height Fog
Height fog can be painted with the Height Fog Paint Tools. There can be up to 2 layers of height fog.
- Volume Height - The max height of the fog volume.
- Volume Height Min - The min height of the fog volume.
- Volume Height Falloff - The falloff gradient of the fog volume. A value of
1means there is no decrease in density from the bottom to the top of the volume. A value of0means there is a 100% decrease in density from the bottom to the top of the volume. Invert the volume height and height min to reverse the direction of the falloff. - Volume Density - Density of the fog. Normal value is low, around
.05. - Volume Albedo - Color of the fog.
- Volume Albedo Cube Map - Path to a .tga that applies color to the fog. Can be a Lat Long or gradient.
- Volume Parms Map - Path to the .tga that defines the painted height (R), density (G), and falloff (B) scales. Should be created with the fog paint tool.
- Volume Albedo Cube Map Blend Ratio - Scalar for the amount of color applied from the albedo cube map.
- Volume Parms Map Scale - Scalar for the amount of height/density/falloff applied from the painted parms map. Usually set to
1. - Volume Density Variation Min - Controls the min threshold of the noise used for density variation.
- Volume Density Variation Max - Controls the max threshold of the noise used for density variation.
- Volume Density Tiling - Tiling of the noise used for density variation.
- Volume Density Scroll X - Amplitude of fog scrolling in the x direction.
- Volume Density Scroll Y - Amplitude of fog scrolling in the y direction.
- Volume Flow Map - Path to a .tga flow map that applies motion to the fog. Should be created with the fog paint tool.
- Volume Flow Map Scale - Amplitude at which the flow map is applied.
- Volume Flow Map Time Scale - Frequency at which the flow map is applied.
Other Settings
- Max View Distance - Maximum distance that is rendered from the camera location. Default is
8192. Raising this has perf ramifications, so keep it as low as possible.
Sky Settings
- Enable Sky Bake - Needs to stay on for proper lighting.
- Enable Sun Sprite - Shows the sun location. Can turn this off if the sun is painted into the skydome.
- Sun Intensity - The strength of the sun in Lux.
- Sun Intensity Table - Can be used to add a light table to the sun intensity. Useful for a thunderstorm environment.
- Sun Table Duration - Controls the length of the sun intensity table. A higher number means slower looping of the table.
- Sun Color - The tint of the sun. This value should usually be close to white.
- Clouds/Sky Sun Color Override - Check this on to enable an override sun color that only affects the sky/atmosphere/fog but not the diffuse light color.
- Clouds/Sky Sun Color - The color of the optional sun color override.
- Sun Latitude - Latitude/vertical position of the sun. Think of it like steps on a ladder.
- Sun Longitude - Longitude/horizontal position of the sun.
- Sky HDR Alpha Blend Ratio - Affects all surfaces using the sky hdr material. A multiplier on their blending with atmosphere.
- Sky Dome Material - Deprecated.
- Scattering Density Scale - Amount of sun scattering in the atmosphere. Too high of values can lead to mismatch between clouds and atmosphere.
- Sun Shadow Scattering Multiplier - Scalar for how much sun shadows affect fog and atmosphere. Can be used to help fix areas with low scattering due to sun shadows.
- Mie Color - Tint of the Mie color.
- Mie Height - Height range of the Mie.
- Mie Density Scale - Density of Mie scattering. The larger the number, the brighter the Mie scatter.
- Mie Anisotropy - Mie behavior relative to the sun direction.
- Rayleigh Color - Tint of the Rayleigh color.
- Rayleigh Height - Height of the Rayleigh scattering.
- Rayleigh Density Scale - Scalar for Rayleigh density. Can give better results with clouds than raising the Scattering Density Scale. :::tip Mie and Rayleigh Color As a general rule, if you have a warm sun color, you will want a warm Mie and a cool Rayleigh.
Conversely, if you have a cool sun color, use a cool Mie and a warm Rayleigh. :::
- Planet Radius (km) - Radius of the planet for atmosphere scattering. Can be changed to reduce banding in the atmosphere.
- Planet Surface Z - Location of the horizon on z.
- Echo Lighting Longitude - Attribute should be set to
0.
Sky Cloud
These settings control the look of painted procedural clouds.
- Cloud Shadow Scalar (Scattering) - Scalar for how much clouds affect overall atmosphere scattering.
- Cloud Shadow Scalar (Cast Shadows) - Scalar for how much clouds cast shadows from the sun.
- Enable Clouds - Check this to turn on cloud rendering.
- Enable Cloud Shadows - Check this to turn on cloud shadows (on by default).
- Cloud Coverage Map - Path to the .tga that defines the distribution of the clouds. Coverage is in the red channel and Height is in the green channel. Should be created with the cloud paint tool.
- Cloud Min Z - Min cloud height on z.
- Cloud Density - Density of procedural clouds.
- Use Global Wind - Turn this on to inherit wind settings from the Wind tab.
- Cloud Wind Azimuth.
- Cloud Wind Zenith.
- Cloud Wind Speed - How quickly the clouds scroll. Setting this too high can cause artifacts.
Sun Gobo
- Material - Accepts a World:Light material as the sun gobo. This controls what areas are in light or shadow. In the material texture, areas that are white will get full sunlight, while areas that are black will get no sunlight. Material contains 2 textures, one for near and one for far light projection. Can be used to create cloud shadows or to create areas of focus.
- Tiling - The tiling of the gobo material. The higher the number, the more times it tiles.
- Motion X - Movement of the sun gobo in the X direction (near).
- Motion Y - Movement of the sun gobo in the Y direction (near).
- Intensity - Scalar for the intensity of the gobo (near).
- Height Max - The z height at which the sun gobo stops being applied (anything above height max receives full gobo contribution). Useful for controlling the gobo contribution on overhead height fog.
- Height Min - The z height at the which the sun gobo stops being applied (anything below height min receives 0 gobo contribution).
- Enable Far Sun Gobo - Turn on to enable the far gobo.
- Min Distance Falloff - Min distance from the camera at which the switch from near to far is started.
- Max Distance Falloff - Max distance from the camera at which the switch from near to far is completed.
- Mix Near/Far Sun Gobo - Scalar of how visible the far gobo is.
0will show only the near gobo, and1will show both near and far at full intensity. - Far Tiling - Tiling of the far gobo texture.
- Far Motion X - Movement of the sun gobo in the X direction (far).
- Far Motion Y - Movement of the sun gobo in the Y direction (far).
- Far Intensity - Scalar for the intensity of the gobo (far).
- Far Height Max - The height at which the sun gobo stops being applied (far).
- Far Height Min - The height at which the sun gobo stops being applied (far).
Sun Shadow
- Slice Step – Size of the first and most accurate shadow map. It’s fine to increase this value, but it might end up in a loss of precision in the nearest slice especially at lower quality settings where the shadow maps can be fairly low resolution.
- Last Slice – Override that defines the size of the biggest (least accurate) slice.
- Log Base – Size coefficient between the slices.
- Example: With the settings below, the slices will be
10m,30m,90m,2000m.
- Example: With the settings below, the slices will be
- Sun Backface Shadow - Set to
0. - Sun Cascade Depth Ranges - Set to
0. - Number of Forced Dynamic Slices - Set to
0. - Camera Cut Slices - Set to
0.
Other
- Allow Override - If true, another env can override this one.
- No Shadow Cache - When checked, this env will not generate a shadow cache when the shadow cache is built. This should be true for envs used in cutscenes.
- Blend Duration - Duration in seconds to completely fade out the env. Useful for changing envs in cutscenes.