Struct Light

Provides a base class for different kinds of light nodes.

struct Light ;

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.

Properties

NameTypeDescription
editorOnly[get, set] boolIf true, the light only appears in the editor and will not be visible at runtime.
lightBakeMode[get, set] Light.BakeModeThe light's bake mode. See bakemode.
lightColor[get, set] ColorThe light's color.
lightCullMask[get, set] longThe light will affect objects in the selected layers.
lightEnergy[get, set] doubleThe light's strength multiplier.
lightIndirectEnergy[get, set] doubleSecondary multiplier used with indirect light (light bounces). This works on both BakedLightmap and GIProbe.
lightNegative[get, set] boolIf true, the light's effect is reversed, darkening areas and casting bright shadows.
lightSpecular[get, set] doubleThe intensity of the specular blob in objects affected by the light. At 0 the light becomes a pure diffuse light.
shadowBias[get, set] doubleUsed 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.
shadowColor[get, set] ColorThe color of shadows cast by this light.
shadowContact[get, set] doubleAttempts to reduce shadowBias gap.
shadowEnabled[get, set] boolIf true, the light will cast shadows.
shadowReverseCullFace[get, set] boolIf 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.

Methods

NameDescription
getBakeMode
getColor
getCullMask
getParam Returns the value of the specified Light.param parameter.
getShadowColor
getShadowReverseCullFace
hasShadow
isEditorOnly
isNegative
setBakeMode
setColor
setCullMask
setEditorOnly
setNegative
setParam Sets the value of the specified Light.param parameter.
setShadow
setShadowColor
setShadowReverseCullFace

Enums

NameDescription
BakeMode
Constants
Param