Light

Inherits: VisualInstance < Spatial < Node < Object

Inherited By: DirectionalLight, OmniLight, SpotLight

Provides a base class for different kinds of light nodes.

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.

Methods

floatget_param ( Param param ) const
voidset_param ( Param param, float value )

Enumerations

enum Param:


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).
  • 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).

Property Descriptions

Defaultfalse
Setterset_editor_only(value)
Getteris_editor_only()

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


Default1
Setterset_bake_mode(value)
Getterget_bake_mode()

The light’s bake mode. See BakeMode.


DefaultColor( 1, 1, 1, 1 )
Setterset_color(value)
Getterget_color()

The light’s color.


  • int light_cull_mask
Default4294967295
Setterset_cull_mask(value)
Getterget_cull_mask()

The light will affect objects in the selected layers.


Default1.0
Setterset_param(value)
Getterget_param()

The light’s strength multiplier.


  • float light_indirect_energy
Default1.0
Setterset_param(value)
Getterget_param()

Secondary multiplier used with indirect light (light bounces). This works on both BakedLightmap and GIProbe.


Defaultfalse
Setterset_negative(value)
Getteris_negative()

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


Default0.5
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.


Default0.15
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.


DefaultColor( 0, 0, 0, 1 )
Setterset_shadow_color(value)
Getterget_shadow_color()

The color of shadows cast by this light.


Default0.0
Setterset_param(value)
Getterget_param()

Attempts to reduce shadow_bias gap.


Defaultfalse
Setterset_shadow(value)
Getterhas_shadow()

If true, the light will cast shadows.


  • bool shadow_reverse_cull_face
Defaultfalse
Setterset_shadow_reverse_cull_face(value)
Getterget_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.

Method Descriptions

Returns the value of the specified Param parameter.


Sets the value of the specified Param parameter.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.