Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Provides a base class for different kinds of light nodes.
Light3D is the abstract base class for light nodes. As it can't be instantiated, it shouldn't be used directly. Other types of light nodes inherit from it. Light3D contains the common variables and parameters used for lighting.
get_correlated_color ( ) const
Param PARAM_ENERGY =
Constant for accessing light_energy.
Param PARAM_INDIRECT_ENERGY =
Constant for accessing light_indirect_energy.
Param PARAM_VOLUMETRIC_FOG_ENERGY =
Constant for accessing light_volumetric_fog_energy.
Param PARAM_SPECULAR =
Constant for accessing light_specular.
Param PARAM_RANGE =
Param PARAM_SIZE =
Constant for accessing light_size.
Param PARAM_ATTENUATION =
Param PARAM_SPOT_ANGLE =
Constant for accessing SpotLight3D.spot_angle.
Param PARAM_SPOT_ATTENUATION =
Constant for accessing SpotLight3D.spot_angle_attenuation.
Param PARAM_SHADOW_MAX_DISTANCE =
Constant for accessing DirectionalLight3D.directional_shadow_max_distance.
Param PARAM_SHADOW_SPLIT_1_OFFSET =
Constant for accessing DirectionalLight3D.directional_shadow_split_1.
Param PARAM_SHADOW_SPLIT_2_OFFSET =
Constant for accessing DirectionalLight3D.directional_shadow_split_2.
Param PARAM_SHADOW_SPLIT_3_OFFSET =
Constant for accessing DirectionalLight3D.directional_shadow_split_3.
Param PARAM_SHADOW_FADE_START =
Constant for accessing DirectionalLight3D.directional_shadow_fade_start.
Param PARAM_SHADOW_NORMAL_BIAS =
Constant for accessing shadow_normal_bias.
Param PARAM_SHADOW_BIAS =
Constant for accessing shadow_bias.
Param PARAM_SHADOW_PANCAKE_SIZE =
Constant for accessing DirectionalLight3D.directional_shadow_pancake_size.
Param PARAM_SHADOW_OPACITY =
Constant for accessing shadow_opacity.
Param PARAM_SHADOW_BLUR =
Constant for accessing shadow_blur.
Param PARAM_TRANSMITTANCE_BIAS =
Constant for accessing shadow_transmittance_bias.
Param PARAM_INTENSITY =
Constant for accessing light_intensity_lumens and light_intensity_lux. Only used when ProjectSettings.rendering/lights_and_shadows/use_physical_light_units is
Param PARAM_MAX =
Represents the size of the Param enum.
BakeMode BAKE_DISABLED =
Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights.
BakeMode BAKE_STATIC =
Light is taken into account in static baking (VoxelGI, LightmapGI, SDFGI (Environment.sdfgi_enabled)). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off.
BakeMode BAKE_DYNAMIC =
Light is taken into account in dynamic baking (VoxelGI and SDFGI (Environment.sdfgi_enabled) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to BAKE_STATIC. This has a greater performance cost compared to BAKE_STATIC. When using SDFGI, the update speed of dynamic lights is affected by ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights.
float distance_fade_begin =
The distance from the camera at which the light begins to fade away (in 3D units).
bool distance_fade_enabled =
true, the light will smoothly fade away when far from the active Camera3D starting at distance_fade_begin. This acts as a form of level of detail (LOD). The light will fade out over distance_fade_begin + distance_fade_length, after which it will be culled and not sent to the shader at all. Use this to reduce the number of active lights in a scene and thus improve performance.
float distance_fade_length =
Distance over which the light and its shadow fades. The light's energy and shadow's opacity is progressively reduced over this distance and is completely invisible at the end.
float distance_fade_shadow =
The distance from the camera at which the light's shadow cuts off (in 3D units). Set this to a value lower than distance_fade_begin + distance_fade_length to further improve performance, as shadow rendering is often more expensive than light rendering itself.
bool editor_only =
float light_angular_distance =
The light's angular size in degrees. Increasing this will make shadows softer at greater distances (also called percentage-closer soft shadows, or PCSS). Only available for DirectionalLight3Ds. For reference, the Sun from the Earth is approximately
0.5. Increasing this value above
0.0 for lights with shadows enabled will have a noticeable performance cost due to PCSS.
Note: PCSS for directional lights is only supported in the Forward+ rendering method, not Mobile or Compatibility.
BakeMode light_bake_mode =
The light's bake mode. This will affect the global illumination techniques that have an effect on the light's rendering. See BakeMode.
Note: Meshes' global illumination mode will also affect the global illumination rendering. See GeometryInstance3D.gi_mode.
Color light_color =
Color(1, 1, 1, 1)
The light's color. An overbright color can be used to achieve a result equivalent to increasing the light's light_energy.
int light_cull_mask =
The light will affect objects in the selected layers.
float light_energy =
The light's strength multiplier (this is not a physical unit). For OmniLight3D and