Light

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.

@GodotBaseClass
struct Light {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

BakeMode
enum BakeMode
Constants
enum Constants
Param
enum Param

Functions

getBakeMode
Light.BakeMode getBakeMode()
getColor
Color getColor()
getCullMask
long getCullMask()
getParam
double getParam(long param)

Returns the value of the specified Light.param parameter.

getShadowColor
Color getShadowColor()
getShadowReverseCullFace
bool getShadowReverseCullFace()
hasShadow
bool hasShadow()
isEditorOnly
bool isEditorOnly()
isNegative
bool isNegative()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(Light other)
opEquals
bool opEquals(typeof(null) n)
setBakeMode
void setBakeMode(long bake_mode)
setColor
void setColor(Color color)
setCullMask
void setCullMask(long cull_mask)
setEditorOnly
void setEditorOnly(bool editor_only)
setNegative
void setNegative(bool enabled)
setParam
void setParam(long param, double value)

Sets the value of the specified Light.param parameter.

setShadow
void setShadow(bool enabled)
setShadowColor
void setShadowColor(Color shadow_color)
setShadowReverseCullFace
void setShadowReverseCullFace(bool enable)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

editorOnly
bool editorOnly [@property getter]
bool editorOnly [@property setter]

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

lightBakeMode
Light.BakeMode lightBakeMode [@property getter]
long lightBakeMode [@property setter]

The light's bake mode. See bakemode.

lightColor
Color lightColor [@property getter]
Color lightColor [@property setter]

The light's color. An overbright color can be used to achieve a result equivalent to increasing the light's lightEnergy.

lightCullMask
long lightCullMask [@property getter]
long lightCullMask [@property setter]

The light will affect objects in the selected layers.

lightEnergy
double lightEnergy [@property getter]
double lightEnergy [@property setter]

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.

lightIndirectEnergy
double lightIndirectEnergy [@property getter]
double lightIndirectEnergy [@property setter]

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

lightNegative
bool lightNegative [@property getter]
bool lightNegative [@property setter]

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

lightSpecular
double lightSpecular [@property getter]
double lightSpecular [@property setter]

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.

shadowBias
double shadowBias [@property getter]
double shadowBias [@property setter]

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.

shadowColor
Color shadowColor [@property getter]
Color shadowColor [@property setter]

The color of shadows cast by this light.

shadowContact
double shadowContact [@property getter]
double shadowContact [@property setter]

Attempts to reduce shadowBias gap.

shadowEnabled
bool shadowEnabled [@property getter]
bool shadowEnabled [@property setter]

If true, the light will cast shadows.

shadowReverseCullFace
bool shadowReverseCullFace [@property getter]
bool shadowReverseCullFace [@property setter]

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 constant GeometryInstance.SHADOW_CASTING_SETTING_DOUBLE_SIDED.

Static functions

_new
Light _new()

Construct a new instance of Light. Note: use memnew!Light instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta