Inherits: VisualInstance < Spatial < Node < Object
Inherited By: DirectionalLight, OmniLight, SpotLight
Provides a base class for different kinds of light nodes.
Light is the abstract base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.
bool | editor_only | false |
BakeMode | light_bake_mode | 1 |
Color | light_color | Color( 1, 1, 1, 1 ) |
int | light_cull_mask | 4294967295 |
float | light_energy | 1.0 |
float | light_indirect_energy | 1.0 |
bool | light_negative | false |
float | light_specular | 0.5 |
float | shadow_bias | 0.15 |
Color | shadow_color | Color( 0, 0, 0, 1 ) |
float | shadow_contact | 0.0 |
bool | shadow_enabled | false |
bool | shadow_reverse_cull_face | false |
float | get_param ( Param param ) const |
void | set_param ( Param param, float value ) |
enum Param:
enum BakeMode:
Note: Hiding a light does not affect baking.
Note: You should hide the light if you don't want it to appear twice (dynamic and baked).
Default | false |
Setter | set_editor_only(value) |
Getter | is_editor_only() |
If true
, the light only appears in the editor and will not be visible at runtime.
Default | 1 |
Setter | set_bake_mode(value) |
Getter | get_bake_mode() |
The light's bake mode. See BakeMode.
Default | Color( 1, 1, 1, 1 ) |
Setter | set_color(value) |
Getter | get_color() |
The light's color. An overbright color can be used to achieve a result equivalent to increasing the light's light_energy.
Default | 4294967295 |
Setter | set_cull_mask(value) |
Getter | get_cull_mask() |
The light will affect objects in the selected layers.
Default | 1.0 |
Setter | set_param(value) |
Getter | get_param() |
The light's strength multiplier (this is not a physical unit). For OmniLight and SpotLight, changing this value will only change the light color's intensity, not the light's radius.
Default | 1.0 |
Setter | set_param(value) |
Getter | get_param() |
Secondary multiplier used with indirect light (light bounces). This works on both BakedLightmap and GIProbe.
Default | false |
Setter | set_negative(value) |
Getter | is_negative() |
If true
, the light's effect is reversed, darkening areas and casting bright shadows.
Default | 0.5 |
Setter | set_param(value) |
Getter | get_param() |
The intensity of the specular blob in objects affected by the light. At 0
, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface.
Default | 0.15 |
Setter | set_param(value) |
Getter | get_param() |
Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed.
Default | Color( 0, 0, 0, 1 ) |
Setter | set_shadow_color(value) |
Getter | get_shadow_color() |
The color of shadows cast by this light.
Default | 0.0 |
Setter | set_param(value) |
Getter | get_param() |
Attempts to reduce shadow_bias gap.
Default | false |
Setter | set_shadow(value) |
Getter | has_shadow() |
If true
, the light will cast shadows.
Default | false |
Setter | set_shadow_reverse_cull_face(value) |
Getter | get_shadow_reverse_cull_face() |
If true
, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with GeometryInstance.SHADOW_CASTING_SETTING_DOUBLE_SIDED.
Returns the value of the specified Param parameter.
Sets the value of the specified Param parameter.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_light.html