Navigation
API > API/Runtime > API/Runtime/Engine
| Name | ULightComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/LightComponent.h |
| Include Path | #include "Components/LightComponent.h" |
Syntax
UCLASS (Abstract, HideCategories=(Trigger, Activation, "Components|Activation", Physics),
ShowCategories=(Mobility), MinimalAPI)
class ULightComponent : public ULightComponentBase
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → ULightComponentBase → ULightComponent
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULightComponent
(
const FObjectInitializer& ObjectInitializer |
Updates/ resets light GUIDs. | Components/LightComponent.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnUpdateColorAndBrightness | TMulticastDelegate_OneParam< void, ULightComponent & > | Components/LightComponent.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| UpdateColorAndBrightnessEvent | FOnUpdateColorAndBrightness | Called When light color or brightness needs update | Components/LightComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAddedToSceneVisible | uint32 | True when this light component has been added to the scene as a normal visible light. | Components/LightComponent.h | |
| bAllowMegaLights | uint32 | Whether to allow this light to use MegaLights, if it is enabled in the project settings or Post Process Volume. | Components/LightComponent.h |
|
| bCastShadowsFromCinematicObjectsOnly | uint32 | Whether the light should only cast shadows from components marked as bCastCinematicShadows. | Components/LightComponent.h |
|
| bEnableLightShaftBloom | uint32 | Whether to render light shaft bloom from this light. | Components/LightComponent.h |
|
| bForceCachedShadowsForMovablePrimitives | uint32 | Enables cached shadows for movable primitives for this light even if r.shadow.cachedshadowscastfrommovableprimitives is 0 | Components/LightComponent.h |
|
| BloomMaxBrightness | float | After exposure is applied, scene color brightness larger than BloomMaxBrightness will be rescaled down to BloomMaxBrightness. | Components/LightComponent.h |
|
| BloomScale | float | Scales the additive color. | Components/LightComponent.h |
|
| BloomThreshold | float | Scene color must be larger than this to create bloom in the light shafts. | Components/LightComponent.h |
|
| BloomTint | FColor | Multiplies against scene color to create the bloom color. | Components/LightComponent.h |
|
| bOverrideRayEndBias | uint32 | Components/LightComponent.h |
|
|
| bUseIESBrightness | uint32 | True: take light brightness from IES profile, false: use the light brightness - the maximum light in one direction is used to define no masking. | Components/LightComponent.h |
|
| bUseRayTracedDistanceFieldShadows | bool | Whether to use ray traced distance field area shadows. | Components/LightComponent.h |
|
| bUseTemperature | uint32 | False: use white (D65) as illuminant. | Components/LightComponent.h |
|
| CastTranslucentShadows | uint32 | Whether the light is allowed to cast dynamic shadows from translucency. | Components/LightComponent.h |
|
| ContactShadowCastingIntensity | float | Intensity of the shadows cast by primitives with "cast contact shadow" enabled. | Components/LightComponent.h |
|
| ContactShadowLength | float | Length of screen space ray trace for sharp contact shadows. Zero is disabled. | Components/LightComponent.h |
|
| ContactShadowLengthInWS | uint32 | Where Length of screen space ray trace for sharp contact shadows is in world space units or in screen space units. | Components/LightComponent.h |
|
| ContactShadowNonCastingIntensity | float | Intensity of the shadows cast by primitives with "cast contact shadow" disabled. | Components/LightComponent.h |
|
| DestroyFence | FRenderCommandFence | Fence used to track progress of render resource destruction. | Components/LightComponent.h | |
| DiffuseScale | float | Multiplier on diffuse lighting. | Components/LightComponent.h |
|
| DisabledBrightness | float | Brightness factor applied to the light when the light function is specified but disabled, for example in scene captures that use SceneCapView_LitNoShadows. | Components/LightComponent.h |
|
| IESBrightnessScale | float | Global scale for IES brightness contribution. | Components/LightComponent.h |
|
| IESTexture | TObjectPtr< class UTextureLightProfile > | IES texture (light profiles from real world measured data) | Components/LightComponent.h |
|
| LightFunctionFadeDistance | float | Distance at which the light function should be completely faded to DisabledBrightness. | Components/LightComponent.h |
|
| LightFunctionMaterial | TObjectPtr< class UMaterialInterface > | The light function material to be applied to this light. | Components/LightComponent.h |
|
| LightFunctionScale | FVector | Scales the light function projection. | Components/LightComponent.h |
|
| LightingChannels | FLightingChannels | Channels that this light should affect. | Components/LightComponent.h |
|
| MaxDistanceFadeRange | float | Fade the light out as it approaches MaxDrawDistance. | Components/LightComponent.h |
|
| MaxDrawDistance | float | World distance to where the light stops rendering (lighting & shadows). | Components/LightComponent.h |
|
| MegaLightsShadowMethod | TEnumAsByte< EMegaLightsShadowMethod::Type > | Selects which shadowing method should MegaLights use for this light. | Components/LightComponent.h |
|
| PreviewShadowMapChannel | int32 | Transient shadowmap channel used to preview the results of stationary light shadowmap packing. | Components/LightComponent.h |
|
| RayEndBias | float | Components/LightComponent.h |
|
|
| RayStartOffsetDepthScale | float | Controls how large of an offset ray traced shadows have from the receiving surface as the camera gets further away. | Components/LightComponent.h |
|
| SceneProxy | FLightSceneProxy * | The light's scene info. | Components/LightComponent.h | |
| ShadowBias | float | Controls how accurate self shadowing of whole scene shadows from this light are. | Components/LightComponent.h |
|
| ShadowResolutionScale | float | Scales the resolution of shadowmaps used to shadow this light. | Components/LightComponent.h |
|
| ShadowSharpen | float | Amount to sharpen shadow filtering | Components/LightComponent.h |
|
| ShadowSlopeBias | float | Controls how accurate self shadowing of whole scene shadows from this light are. | Components/LightComponent.h |
|
| SpecularScale | float | Multiplier on specular highlights. | Components/LightComponent.h |
|
| StashedLightFunctionMaterial | TObjectPtr< class UMaterialInterface > | When clearing the light func, e.g. because the light is made static, this field remembers the last value | Components/LightComponent.h |
|
| StaticShadowDepthMap | FStaticShadowDepthMap | Components/LightComponent.h | ||
| Temperature | float | Color temperature in Kelvin of the blackbody illuminant. White (D65) is 6500K. | Components/LightComponent.h |
|
| ViewLightingChannels | FViewLightingChannels | View / light masking support. Controls which views this light should affect. | Components/LightComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool AffectsBounds
(
const FBoxSphereBounds& InBounds |
Test whether the light affects the given bounding volume. | Components/LightComponent.h | |
bool AffectsPrimitive
(
const UPrimitiveComponent* Primitive |
Test whether this light affects the given primitive. | Components/LightComponent.h | |
void ApplyComponentInstanceData
(
FPrecomputedLightInstanceData* ComponentInstanceData |
Components/LightComponent.h | ||
void ClearLightFunctionMaterial() |
Set the light func to null, but remember the current value so it can be restored later | Components/LightComponent.h | |
virtual float ComputeLightBrightness() |
Compute current light brightness based on whether there is a valid IES profile texture attached, and whether IES brightness is enabled | Components/LightComponent.h | |
virtual FLightSceneProxy * CreateSceneProxy() |
Components/LightComponent.h | ||
virtual FLinearColor GetAtmosphereSunDiskColorScale() |
Components/LightComponent.h | ||
virtual uint8 GetAtmosphereSunLightIndex() |
Components/LightComponent.h | ||
virtual FBox GetBoundingBox() |
Return the world-space bounding box of the light's influence. | Components/LightComponent.h | |
virtual FSphere GetBoundingSphere() |
Components/LightComponent.h | ||
FLinearColor GetColoredLightBrightness() |
Components/LightComponent.h | ||
FLinearColor GetColorTemperature() |
Get the color temperature in the working color space. | Components/LightComponent.h | |
FVector GetDirection() |
Script interface to retrieve light direction. | Components/LightComponent.h | |
const FLightComponentMapBuildData * GetLightComponentMapBuildData() |
Components/LightComponent.h | ||
virtual FLightmassLightSettings GetLightmassSettings() |
Components/LightComponent.h | ||
virtual FVector4 GetLightPosition() |
Return the homogenous position of the light. | Components/LightComponent.h | |
virtual ELightComponentType GetLightType() |
Components/LightComponent.h | ||
virtual ELightUnits GetLightUnits() |
Components/LightComponent.h | ||
virtual UMaterialInterface * GetMaterial
(
int32 ElementIndex |
Components/LightComponent.h | ||
virtual int32 GetNumMaterials() |
Components/LightComponent.h | ||
virtual float GetUniformPenumbraSize() |
Components/LightComponent.h | ||
void InitializeStaticShadowDepthMap() |
Components/LightComponent.h | ||
bool IsShadowCast
(
UPrimitiveComponent* Primitive |
Check whether a given primitive will cast shadows from this light. | Components/LightComponent.h | |
virtual bool IsUsedAsAtmosphereSunLight() |
Whether to consider light as a sunlight for atmospheric scattering. | Components/LightComponent.h | |
void PushSelectionToProxy() |
Pushes new selection state to the render thread light proxy | Components/LightComponent.h | |
void SetAffectTranslucentLighting
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetBloomMaxBrightness
(
float NewValue |
Components/LightComponent.h |
|
|
void SetBloomScale
(
float NewValue |
Components/LightComponent.h |
|
|
void SetBloomThreshold
(
float NewValue |
Components/LightComponent.h |
|
|
void SetBloomTint
(
FColor NewValue |
Components/LightComponent.h |
|
|
void SetDiffuseScale
(
float NewValue |
Components/LightComponent.h |
|
|
void SetEnableLightShaftBloom
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetForceCachedShadowsForMovablePrimitives
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetIESBrightnessScale
(
float NewValue |
Components/LightComponent.h |
|
|
void SetIESTexture
(
UTextureLightProfile* NewValue |
Components/LightComponent.h |
|
|
void SetIndirectLightingIntensity
(
float NewIntensity |
Components/LightComponent.h |
|
|
void SetIntensity
(
float NewIntensity |
Set intensity of the lightSet brightness of the light | Components/LightComponent.h |
|
virtual void SetLightBrightness
(
float InBrightness |
Set the Intensity using the brightness. The unit of brightness depends on the light type. | Components/LightComponent.h | |
void SetLightColor
(
FLinearColor NewLightColor, |
Set color of the light | Components/LightComponent.h |
|
void SetLightFColor
(
FColor NewLightColor |
Set color of the light | Components/LightComponent.h |
|
void SetLightFunctionDisabledBrightness
(
float NewValue |
Components/LightComponent.h |
|
|
void SetLightFunctionFadeDistance
(
float NewLightFunctionFadeDistance |
Components/LightComponent.h |
|
|
void SetLightFunctionMaterial
(
UMaterialInterface* NewLightFunctionMaterial |
Components/LightComponent.h |
|
|
void SetLightFunctionScale
(
FVector NewLightFunctionScale |
Components/LightComponent.h |
|
|
void SetLightingChannels
(
bool bChannel0, |
Components/LightComponent.h |
|
|
virtual void SetMaterial
(
int32 ElementIndex, |
Set the MaterialInterface to use for the given element index (if valid) | Components/LightComponent.h | |
void SetMaxDistanceFadeRange
(
float NewValue |
Components/LightComponent.h |
|
|
void SetMaxDrawDistance
(
float NewValue |
Components/LightComponent.h |
|
|
void SetShadowBias
(
float NewValue |
Components/LightComponent.h |
|
|
void SetShadowSlopeBias
(
float NewValue |
Components/LightComponent.h |
|
|
void SetSpecularScale
(
float NewValue |
Components/LightComponent.h |
|
|
void SetTemperature
(
float NewTemperature |
Set color temperature of the light | Components/LightComponent.h |
|
void SetTransmission
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetUseIESBrightness
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetUseRayTracedDistanceFieldShadows
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetUseTemperature
(
bool bNewValue |
Components/LightComponent.h |
|
|
void SetVolumetricScatteringIntensity
(
float NewIntensity |
Components/LightComponent.h |
|
|
void UpdateColorAndBrightness() |
Script interface to update the color and brightness on the render thread. | Components/LightComponent.h |
Overridden from ULightComponentBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void UpdateLightSpriteTexture() |
Update the texture used on the editor sprite | Components/LightComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsPrecomputedLightingValid() |
True if our precomputed lighting is up to date | Components/LightComponent.h | |
virtual void PropagateLightingScenarioChange() |
Updates any visuals after the lighting has changed | Components/LightComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CheckForErrors () |
Function that gets called from within Map_Check to allow this actor component to check itself for any potential errors and register them with map check dialog. | Components/LightComponent.h | |
virtual TStructOnScope< FActorComponentInstanceData > GetComponentInstanceData() |
Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation | Components/LightComponent.h | |
virtual FBox GetStreamingBounds() |
Components/LightComponent.h | ||
virtual void InvalidateLightingCacheDetailed
(
bool bInvalidateBuildEnqueuedLighting, |
Called when this actor component has moved, allowing it to discard statically cached lighting information. | Components/LightComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Components/LightComponent.h | ||
virtual bool CanEditChange
(
const FProperty* InProperty |
Components/LightComponent.h | ||
virtual bool IsReadyForFinishDestroy() |
Components/LightComponent.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Components/LightComponent.h | ||
virtual void PostLoad() |
Called after this UObject has been serialized | Components/LightComponent.h | |
virtual void PreSave
(
FObjectPreSaveContext ObjectSaveContext |
Components/LightComponent.h | ||
virtual void Serialize
(
FArchive& Ar |
Components/LightComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void UpdateProxy
(
FUpdateLightProxyCallback&& Func |
Components/LightComponent.h |
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Returns full material property path and UObject owner property object Path examples: Material property path with array element and inner struct Materials[0].InnerStruct.Material Material property path with array element Materials[0] Simple material property path Materials | Components/LightComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CreateRenderState_Concurrent
(
FRegisterComponentContext* Context |
Used to create any rendering thread information for this component | Components/LightComponent.h | |
virtual void DestroyRenderState_Concurrent () |
Used to shut down any rendering thread structure for this component | Components/LightComponent.h | |
virtual void OnRegister() |
UActorComponent Interface | Components/LightComponent.h | |
virtual void SendRenderTransform_Concurrent () |
Called to send a transform update for this component to the rendering thread | Components/LightComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ReassignStationaryLightChannels
(
UWorld* TargetWorld, |
Iterates over ALL stationary light components in the target world and assigns their preview shadowmap channel, and updates light icons accordingly. | Components/LightComponent.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InverseSquaredFalloff_DEPRECATED | uint32 | Components/LightComponent.h | ||
| MinRoughness_DEPRECATED | float | Min roughness effective for this light. Used for softening specular highlights. | Components/LightComponent.h | |
| ShadowMapChannel_DEPRECATED | int32 | Legacy shadowmap channel from the lighting build, now stored in FLightComponentMapBuildData. | Components/LightComponent.h |