Light

Inherits: VisualInstance < Spatial < Node < Object

Inherited By: DirectionalLight, OmniLight, SpotLight

Category: Core

Brief Description

Provides a base class for different kinds of light nodes.

Properties

booleditor_only
BakeModelight_bake_mode
Colorlight_color
intlight_cull_mask
floatlight_energy
floatlight_indirect_energy
boollight_negative
floatlight_specular
floatshadow_bias
Colorshadow_color
floatshadow_contact
boolshadow_enabled
boolshadow_reverse_cull_face

Enumerations

enum Param:

  • PARAM_ENERGY = 0
  • PARAM_INDIRECT_ENERGY = 1
  • PARAM_SPECULAR = 2
  • PARAM_RANGE = 3
  • PARAM_ATTENUATION = 4
  • PARAM_SPOT_ANGLE = 5
  • PARAM_SPOT_ATTENUATION = 6
  • PARAM_CONTACT_SHADOW_SIZE = 7
  • PARAM_SHADOW_MAX_DISTANCE = 8
  • PARAM_SHADOW_SPLIT_1_OFFSET = 9
  • PARAM_SHADOW_SPLIT_2_OFFSET = 10
  • PARAM_SHADOW_SPLIT_3_OFFSET = 11
  • PARAM_SHADOW_NORMAL_BIAS = 12
  • PARAM_SHADOW_BIAS = 13
  • PARAM_SHADOW_BIAS_SPLIT_SCALE = 14
  • PARAM_MAX = 15 — Represents the size of the Param enum.

enum BakeMode:

  • BAKE_DISABLED = 0 — Light is ignored when baking. Note: hiding a light does not affect baking.
  • BAKE_INDIRECT = 1 — Only indirect lighting will be baked. Default value.
  • BAKE_ALL = 2 — Both direct and indirect light will be baked. Note: you should hide the light if you don’t want it to appear twice (dynamic and baked).

Description

Light is the abstract base class for light nodes, so it shouldn’t be used directly (It can’t be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting.

Tutorials

Property Descriptions

Setterset_editor_only(value)
Getteris_editor_only()

If true, the light only appears in the editor and will not be visible at runtime. Default value:false.


Setterset_bake_mode(value)
Getterget_bake_mode()

The light’s bake mode. See BakeMode.


Setterset_color(value)
Getterget_color()

The light’s color.


  • int light_cull_mask
Setterset_cull_mask(value)
Getterget_cull_mask()

The light will affect objects in the selected layers.


Setterset_param(value)
Getterget_param()

The light’s strength multiplier.


  • float light_indirect_energy
Setterset_param(value)
Getterget_param()

Secondary multiplier used with indirect light (light bounces). This works in baked light or GIProbe.


  • bool light_negative
Setterset_negative(value)
Getteris_negative()

If true, the light’s effect is reversed, darkening areas and casting bright shadows. Default value: false.


Setterset_param(value)
Getterget_param()

The intensity of the specular blob in objects affected by the light. At 0 the light becomes a pure diffuse light.


Setterset_param(value)
Getterget_param()

Used to adjust shadow appearance. Too small a value results in self shadowing, while too large a value causes shadows to separate from casters. Adjust as needed.


Setterset_shadow_color(value)
Getterget_shadow_color()

The color of shadows cast by this light.


Setterset_param(value)
Getterget_param()

Attempts to reduce shadow_bias gap.


  • bool shadow_enabled
Setterset_shadow(value)
Getterhas_shadow()

If true, the light will cast shadows. Default value: false.


  • bool shadow_reverse_cull_face
Setterset_shadow_reverse_cull_face(value)
Getterget_shadow_reverse_cull_face()