ULightComponent

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/LightComponent.h

Include

#include "Components/LightComponent.h"

Syntax

class ULightComponent : public ULightComponentBase

Variables

Name Description

Public variable

uint32: 1

 

bAddedToSceneVisible

True when this light component has been added to the scene as a normal visible light.

Public variable

uint32: 1

 

bAffectDynamicIndirectLighting

Whether the light should be injected into the Light Propagation Volume

Public variable

uint32: 1

 

bCastShadowsFromCinematicObjectsOnly

Whether the light should only cast shadows from components marked as bCastCinematicShadows.

Public variable

uint32: 1

 

bEnableLightShaftBloom

Whether to render light shaft bloom from this light.

Public variable

uint32: 1

 

bForceCachedShadowsForMovablePrimitives

Enables cached shadows for movable primitives for this light even if r.shadow.cachedshadowscastfrommovableprimitives is 0

Public variable

float

 

BloomMaxBrightness

After exposure is applied, scene color brightness larger than BloomMaxBrightness will be rescaled down to BloomMaxBrightness.

Public variable

float

 

BloomScale

Scales the additive color.

Public variable

float

 

BloomThreshold

Scene color must be larger than this to create bloom in the light shafts.

Public variable

FColor

 

BloomTint

Multiplies against scene color to create the bloom color.

Public variable

uint32: 1

 

bUseIESBrightness

True: take light brightness from IES profile, false: use the light brightness - the maximum light in one direction is used to define no masking.

Public variable

bool

 

bUseRayTracedDistanceFieldShadows

Whether to use ray traced distance field area shadows.

Public variable

uint32: 1

 

bUseTemperature

False: use white (D65) as illuminant.

Public variable

uint32: 1

 

CastTranslucentShadows

Whether the light is allowed to cast dynamic shadows from translucency.

Public variable

float

 

ContactShadowLength

Length of screen space ray trace for sharp contact shadows. Zero is disabled.

Public variable

uint32: 1

 

ContactShadowLengthInWS

Where Length of screen space ray trace for sharp contact shadows is in world space units or in screen space units.

Public variable

FRenderCommandF...

 

DestroyFence

Fence used to track progress of render resource destruction.

Public variable

float

 

DisabledBrightness

Brightness factor applied to the light when the light function is specified but disabled, for example in scene captures that use SceneCapView_LitNoShadows.

Public variable

float

 

IESBrightnessScale

Global scale for IES brightness contribution.

Public variable

UTextureLightPr...

 

IESTexture

IES texture (light profiles from real world measured data)

Public variable

float

 

LightFunctionFadeDistance

Distance at which the light function should be completely faded to DisabledBrightness.

Public variable

UMaterialInterf...

 

LightFunctionMaterial

The light function material to be applied to this light.

Public variable

FVector

 

LightFunctionScale

Scales the light function projection.

Public variable

FLightingChanne...

 

LightingChannels

Channels that this light should affect.

Public variable

float

 

MaxDistanceFadeRange

Public variable

float

 

MaxDrawDistance

Public variable

int32

 

PreviewShadowMapChannel

Transient shadowmap channel used to preview the results of stationary light shadowmap packing.

Public variable

float

 

RayStartOffsetDepthScale

Controls how large of an offset ray traced shadows have from the receiving surface as the camera gets further away.

Public variable

FLightSceneProx...

 

SceneProxy

The light's scene info.

Public variable

float

 

ShadowBias

Controls how accurate self shadowing of whole scene shadows from this light are.

Public variable

float

 

ShadowResolutionScale

Scales the resolution of shadowmaps used to shadow this light.

Public variable

float

 

ShadowSharpen

Amount to sharpen shadow filtering

Public variable

float

 

ShadowSlopeBias

Controls how accurate self shadowing of whole scene shadows from this light are.

Public variable

float

 

SpecularScale

Multiplier on specular highlights.

Public variable

FStaticShadowDe...

 

StaticShadowDepthMap

Public variable

float

 

Temperature

Color temperature in Kelvin of the blackbody illuminant. White (D65) is 6500K.

Constructors

Name Description

Public function

ULightComponent

(
    const FObjectInitializer& ObjectIn...
)

Updates/ resets light GUIDs.

Functions

Name Description

Public function Virtual Const

bool

 

AffectsBounds

(
    const FBoxSphereBounds& InBounds
)

Test whether the light affects the given bounding volume.

Public function Const

bool

 

AffectsPrimitive

(
    const UPrimitiveComponent* Pri...
)

Test whether this light affects the given primitive.

Public function

void

 

ApplyComponentInstanceData

Public function Virtual Const

float

 

ComputeLightBrightness()

Compute current light brightness based on whether there is a valid IES profile texture attached, and whether IES brightness is enabled

Public function Virtual Const

FLightSceneP...

 

CreateSceneProxy()

Public function Virtual Const

uint8

 

GetAtmosphereSunLightIndex()

Public function Virtual Const

FBox

 

GetBoundingBox()

Return the world-space bounding box of the light's influence.

Public function Virtual Const

FSphere

 

GetBoundingSphere()

Public function Const

FLinearColor

 

GetColoredLightBrightness()

Public function Const

FVector

 

GetDirection()

Script interface to retrieve light direction.

Public function Const

const FLight...

 

GetLightComponentMapBuildData()

Public function Virtual Const

FLightmassLi...

 

GetLightmassSettings()

Public function Virtual Const

FVector4

 

GetLightPosition()

Return the homogenous position of the light.

Public function Virtual Const

ELightCompon...

 

GetLightType()

Public function Virtual Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Public function Virtual Const

int32

 

GetNumMaterials()

Public function Virtual Const

float

 

GetUniformPenumbraSize()

Public function

void

 

InitializeStaticShadowDepthMap()

Public function

void

 

InvalidateLightingCacheInner

(
    bool bRecreateLightGuids
)

Invalidates the light's cached lighting with the option to recreate the light Guids.

Public function Const

bool

 

IsShadowCast

(
    UPrimitiveComponent* Primitive
)

Check whether a given primitive will cast shadows from this light.

Public function Virtual Const

bool

 

IsUsedAsAtmosphereSunLight()

Whether to consider light as a sunlight for atmospheric scattering.

Public function Static

void

 

ReassignStationaryLightChannels

(
    UWorld* TargetWorld,
    bool bAssignForLightingBuild,
    ULevel* LightingScenario
)

Iterates over ALL stationary light components in the target world and assigns their preview shadowmap channel, and updates light icons accordingly.

Public function

void

 

SetAffectDynamicIndirectLighting

(
    bool bNewValue
)

Public function

void

 

SetAffectTranslucentLighting

(
    bool bNewValue
)

Public function

void

 

SetBloomMaxBrightness

(
    float NewValue
)

Public function

void

 

SetBloomScale

(
    float NewValue
)

Public function

void

 

SetBloomThreshold

(
    float NewValue
)

Public function

void

 

SetBloomTint

(
    FColor NewValue
)

Public function

void

 

SetEnableLightShaftBloom

(
    bool bNewValue
)

Public function

void

 

SetForceCachedShadowsForMovablePrimitives

(
    bool bNewValue
)

Public function

void

 

SetIESBrightnessScale

(
    float NewValue
)

Public function

void

 

SetIESTexture

(
    UTextureLightProfile* NewValue
)

Public function

void

 

SetIndirectLightingIntensity

(
    float NewIntensity
)

Public function

void

 

SetIntensity

(
    float NewIntensity
)

Set intensity of the light

Set brightness of the light

Public function Virtual

void

 

SetLightBrightness

(
    float InBrightness
)

Set the Intensity using the brightness. The unit of brightness depends on the light type.

Public function

void

 

SetLightColor

(
    FLinearColor NewLightColor,
    bool bSRGB
)

Set color of the light

Public function

void

 

SetLightFunctionDisabledBrightness

(
    float NewValue
)

Public function

void

 

SetLightFunctionFadeDistance

(
    float NewLightFunctionFadeDistance
)

Public function

void

 

SetLightFunctionMaterial

(
    UMaterialInterface* NewLightFu...
)

Public function

void

 

SetLightFunctionScale

(
    FVector NewLightFunctionScale
)

Public function

void

 

SetLightingChannels

(
    bool bChannel0,
    bool bChannel1,
    bool bChannel2
)

Public function Virtual

void

 

SetMaterial

(
    int32 ElementIndex,
    UMaterialInterface* InMaterial
)

Set the MaterialInterface to use for the given element index (if valid)

Public function

void

 

SetShadowBias

(
    float NewValue
)

Public function

void

 

SetShadowSlopeBias

(
    float NewValue
)

Public function

void

 

SetSpecularScale

(
    float NewValue
)

Public function

void

 

SetTemperature

(
    float NewTemperature
)

Set color temperature of the light

Public function

void

 

SetTransmission

(
    bool bNewValue
)

Public function

void

 

SetUseIESBrightness

(
    bool bNewValue
)

Public function

void

 

SetVolumetricScatteringIntensity

(
    float NewIntensity
)

Public function

void

 

UpdateColorAndBrightness()

Script interface to update the color and brightness on the render thread.

Overridden from ULightComponentBase

Name Description

Public function Virtual

void

 

UpdateLightSpriteTexture()

Update the texture used on the editor sprite

Overridden from USceneComponent

Name Description

Public function Virtual Const

bool

 

IsPrecomputedLightingValid()

True if our precomputed lighting is up to date

Public function Virtual

void

 

PropagateLightingScenarioChange()

Updates any visuals after the lighting has changed

Overridden from UActorComponent

Name Description

Protected function Virtual

void

 

CreateRenderState_Concurrent

(
    FRegisterComponentContext* Con...
)

Used to create any rendering thread information for this component

Protected function Virtual

void

 

DestroyRenderState_Concurrent()

Used to shut down any rendering thread structure for this component

Public function Virtual Const

TStructOnSco...

 

GetComponentInstanceData()

Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation

Public function Virtual

void

 

InvalidateLightingCacheDetailed

(
    bool bInvalidateBuildEnqueuedLighti...,
    bool bTranslationOnly
)

Called when this actor component has moved, allowing it to discard statically cached lighting information.

Protected function Virtual

void

 

OnRegister()

UActorComponent Interface

Protected function Virtual

void

 

SendRenderTransform_Concurrent()

Called to send a transform update for this component to the rendering thread

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

bool

 

CanEditChange

(
    const FProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

bool

 

IsReadyForFinishDestroy()

Called to check if the object is ready for FinishDestroy.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostInterpChange

(
    FProperty* PropertyThatChanged
)

Called when property is modified by InterpPropertyTracks

Public function Virtual

void

 

PostLoad()

Called after this UObject has been serialized

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Presave function.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Typedefs

Name

Description

FOnUpdateColorAndBrightness

Constants

Name

Description

UpdateColorAndBrightnessEvent

Called When light color or brightness needs update

Deprecated Variables

Name Description

Public variable

uint32: 1

 

InverseSquaredFalloff_DEPRECATED

Public variable

float

 

MinRoughness_DEPRECATED

Min roughness effective for this light. Used for softening specular highlights.

Public variable

int32

 

ShadowMapChannel_DEPRECATED

Legacy shadowmap channel from the lighting build, now stored in FLightComponentMapBuildData.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss