Functions/Light



Create sources of light.

Inspector Settings



 * Is On - Enabled at level start.
 * Range - Distance that light will travel from source.
 * Color - Colour of light source.
 * Brightness - Intensity of light within Range.
 * Light Type
 * Point - Point light, a "sphere" of unshaped light.
 * Spot - Spotlight effect, uses Spot Light Angle.
 * Dir - Directional light, light from an angle with no discrete source. Best used as a Sun.

''Shadows are computationally expensive. Point lights more so. Use sparingly.''
 * Spot Light Angle - Width of spotlight from source.
 * Use Shadows - Make this light source cast shadows.
 * Flicker Values - A set of numbers, 0 (off) through to 9 (the light's Brightness value), to play through in sequence. Maximum of 20 numbers.
 * Flicker Time - Time window to play Flicker Values settings.
 * Loop Flicker - If set, replay Flicker Values after finishing.
 * Is The Sun - Set if this light source is your sun. ''This has multiple effects, including defining the source of sun glare and FogVolume god ray effects.

Examples
Example Flicker values:
 * Example 1 - 90909090 - Flicker light on and off 4 times within Flicker Time.
 * Example 2 - 0123456789 - Gradually turn light on within Flicker Time.
 * Example 3 - 9876543210 - Gradually turn light off within Flicker Time.

To create a sun in your level, create a light (location does not matter) and set the following settings:
 * Light Type - Dir (rotate the light to set the sun's source angle)
 * Use Shadows - Enabled
 * Is The Sun - Enabled

If Use Shadows is not set, lights will bleed through walls if their Range reaches other rooms.

Use Shadows makes for great visual effects, but is more demanding on the game engine. Options to reduce this impact are:
 * Restrict shadow casters to Spot lights instead of Point lights.
 * Limit the amount of faces which would have shadows cast on them in the light's Range.
 * Reduce the total number of shadow lights in use.
 * Turn off shadow lights when not visible by the player.