FLightSceneProxy

Encapsulates the data which is used to render a light by the rendering thread.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/SceneManagement.h

Include

#include "SceneManagement.h"

Syntax

class FLightSceneProxy

Remarks

Encapsulates the data which is used to render a light by the rendering thread. The constructor is called from the game thread, and after that the rendering thread owns the object. FLightSceneProxy is in the engine module and is subclassed to implement various types of lights.

Variables

Name Description

Protected variable

const FLinearCo...

 

AtmosphereSunDiskColorScale

Protected variable

const uint8

 

AtmosphereSunLightIndex

The index of the atmospheric light.

Protected variable

const uint8: 1

 

bAffectDynamicIndirectLighting

Does the light have dynamic GI?

Protected variable

const uint8: 1

 

bAffectGlobalIllumination

Whether the light affects global illumination, when ray-traced global illumination is enabled.

Protected variable

const uint8: 1

 

bAffectReflection

Whether the light affects objects in reflections, when ray-traced reflection is enabled.

Protected variable

const uint8: 1

 

bAffectTranslucentLighting

Whether the light affects translucency or not.

Protected variable

const uint8: 1

 

bCastDynamicShadow

True if the light casts dynamic shadows.

Protected variable

const uint8: 1

 

bCastHairStrandsDeepShadow

Protected variable

uint8: 1

 

bCastModulatedShadows

Whether the light will cast modulated shadows when using the forward renderer (mobile).

Protected variable

const uint8: 1

 

bCastRaytracedShadow

Whether the light shadows are computed with shadow-mapping or ray-tracing (when available).

Protected variable

const uint8: 1

 

bCastShadowsFromCinematicObjectsOnly

Protected variable

const uint8: 1

 

bCastStaticShadow

True if the light casts static shadows.

Protected variable

const uint8: 1

 

bCastTranslucentShadows

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

Protected variable

const uint8: 1

 

bCastVolumetricShadow

Protected variable

uint8: 1

 

bContactShadowLengthInWS

True: length of screen space ray trace for sharp contact shadows is in world space.

Protected variable

const uint8: 1

 

bForceCachedShadowsForMovablePrimitives

Protected variable

const uint8: 1

 

bHasReflectiveShadowMap

Protected variable

bool

 

bMobileMovablePointLightShouldBeRender

Cached ShouldBeRender for mobile, since if the ShouldBeRender is changed we have to update the movable point lights uniform buffer.

Protected variable

bool

 

bMobileMovablePointLightShouldCastShadow

Cached DynamicShadows show flag for mobile, since if the show flag is changed we have to update the movable point lights uniform buffer.

Protected variable

bool

 

bMobileMovablePointLightUniformBufferNeedsUpdate

If this is TRUE, the light's mobile movable point light uniform buffer needs to be updated before it can be used for mobile base pass rendering.

Protected variable

const uint8: 1

 

bMovable

True if the light's Mobility is set to Movable.

Protected variable

const uint8: 1

 

bStaticLighting

Return True if a light's parameters as well as its position is static during gameplay, and can thus use static lighting.

Protected variable

const uint8: 1

 

bStaticShadowing

Whether the light has static direct shadowing.

Protected variable

uint8: 1

 

bTiledDeferredLightingSupported

Whether the light supports rendering in tiled deferred pass

Protected variable

const uint8: 1

 

bTransmission

Whether light from this light transmits through surfaces with subsurface scattering profiles.

Protected variable

const uint8: 1

 

bUsedAsAtmosphereSunLight

Whether to consider light as a sunlight for atmospheric scattering and exponential height fog.

Protected variable

const uint8: 1

 

bUseRayTracedDistanceFieldShadows

Whether to use ray traced distance field area shadows.

Protected variable

uint8: 1

 

bUseWholeSceneCSMForMovableObjects

Whether to render csm shadows for movable objects only (mobile).

Protected variable

FLinearColor

 

Color

The light color.

Protected variable

FName

 

ComponentName

The name of the light component.

Protected variable

float

 

ContactShadowLength

Length of screen space ray trace for sharp contact shadows.

Protected variable

float

 

DeepShadowLayerDistribution

Deep shadow layer distribution.

Protected variable

uint32

 

FarShadowCascadeCount

Only for whole scene directional lights, 0: no FarShadowCascades, otherwise the count of cascades between WholeSceneDynamicShadowRadius and FarShadowDistance that are covered by distant shadow cascades.

Protected variable

float

 

FarShadowDistance

Only for whole scene directional lights, if FarShadowCascadeCount > 0 and FarShadowDistance >= WholeSceneDynamicShadowRadius, where far shadow cascade should end.

Protected variable

UTextureLightPr...

 

IESTexture

IES texture (light profiles from real world measured data) We are safe to store a U pointer as those objects get deleted deferred, storing an FTexture pointer would crash if we recreate the texture

Protected variable

float

 

IndirectLightingScale

Scale for indirect lighting from this light. When 0, indirect lighting is disabled.

Protected variable

FName

 

LevelName

The name of the level the light is in.

Protected variable

const ULightCom...

 

LightComponent

The light component.

Protected variable

float

 

LightFunctionDisabledBrightness

Protected variable

float

 

LightFunctionFadeDistance

Protected variable

const FMaterial...

 

LightFunctionMaterial

Protected variable

FVector

 

LightFunctionScale

Light function parameters.

Protected variable

FGuid

 

LightGuid

The light's persistent shadowing GUID.

Protected variable

uint8

 

LightingChannelMask

Protected variable

FLightSceneInfo...

 

LightSceneInfo

The light's scene info.

Protected variable

FMatrix

 

LightToWorld

A transform from light space into world space.

Protected variable

const uint8

 

LightType

The light type (ELightComponentType)

Protected variable

FVector4

 

MobileMovablePointLightShadowmapMinMax

Cached the spotlight shadow map min and max value for mobile, since if the value is changed we have to update the movable point lights uniform buffer.

Protected variable

TUniformBufferR...

 

MobileMovablePointLightUniformBuffer

The movable point light's uniform buffer for mobile.

Protected variable

FLinearColor

 

ModulatedShadowColor

Modulated shadow color.

Protected variable

FVector4

 

Position

The homogenous position of the light.

Protected variable

int32

 

PreviewShadowMapChannel

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

Protected variable

float

 

RayStartOffsetDepthScale

Protected variable

uint32

 

SamplesPerPixel

Samples per pixel for ray tracing

Protected variable

FSceneInterface...

 

SceneInterface

The scene the primitive is in.

Protected variable

float

 

ShadowAmount

Control the amount of shadow occlusion.

Protected variable

float

 

ShadowBias

User setting from light component, 0:no bias, 0.5:reasonable, larger object might appear to float

Protected variable

int32

 

ShadowMapChannel

Shadow map channel which is used to match up with the appropriate static shadowing during a deferred shading pass.

Protected variable

float

 

ShadowResolutionScale

Protected variable

float

 

ShadowSharpen

Sharpen shadow filtering

Protected variable

float

 

ShadowSlopeBias

User setting from light component, 0:no bias, 0.5:reasonable, larger object might appear to float

Protected variable

float

 

SpecularScale

Specular scale

Protected variable

const FStaticSh...

 

StaticShadowDepthMap

Protected variable

TStatId

 

StatId

Used for dynamic stats

Protected variable

float

 

VolumetricScatteringIntensity

Scales this light's intensity for volumetric scattering.

Protected variable

FMatrix

 

WorldToLight

A transform from world space into light space.

Constructors

Name Description

Public function

FLightSceneProxy

(
    const ULightComponent* InLight...
)

Initialization constructor.

Destructors

Name Description

Public function Virtual

~FLightSceneProxy()

Functions

Name Description

Public function Const

bool

 

AffectGlobalIllumination()

Public function Const

bool

 

AffectReflection()

Public function Virtual Const

bool

 

AffectsBounds

(
    const FBoxSphereBounds& Bounds
)

Tests whether the light affects the given bounding volume.

Public function Const

bool

 

AffectsTranslucentLighting()

Public function Virtual

void

 

ApplyWorldOffset

(
    FVector InOffset
)

Shifts light position and all relevant data by an arbitrary delta. Called on world origin changes

Public function Const

bool

 

CastsDynamicShadow()

Public function Const

bool

 

CastsHairStrandsDeepShadow()

Public function Const

bool

 

CastsModulatedShadows()

Public function Const

bool

 

CastsRaytracedShadow()

Public function Const

bool

 

CastsShadowsFromCinematicObjectsOnly()

Public function Const

bool

 

CastsStaticShadow()

Public function Const

bool

 

CastsTranslucentShadows()

Public function Const

bool

 

CastsVolumetricShadow()

Public function Const

FLinearColor

 

GetAtmosphereSunDiskColorScale()

Public function Const

uint8

 

GetAtmosphereSunLightIndex()

Public function Virtual Const

FSphere

 

GetBoundingSphere()

Public function Virtual Const

bool

 

GetCastCloudShadows()

Public function Virtual Const

bool

 

GetCastShadowsOnAtmosphere()

Public function Virtual Const

bool

 

GetCastShadowsOnClouds()

Public function Virtual Const

FLinearColor

 

GetCloudScatteredLuminanceScale()

Public function Virtual Const

float

 

GetCloudShadowDepthBias()

Public function Virtual Const

float

 

GetCloudShadowExtent()

Public function Virtual Const

float

 

GetCloudShadowMapResolutionScale()

Public function Virtual Const

float

 

GetCloudShadowOnAtmosphereStrength()

Public function Virtual Const

float

 

GetCloudShadowOnSurfaceStrength()

Public function Virtual Const

float

 

GetCloudShadowRaySampleCountScale()

Public function Virtual Const

float

 

GetCloudShadowStrength()

Public function Const

const FLinea...

 

GetColor()

Public function Const

FName

 

GetComponentName()

Public function Const

float

 

GetContactShadowLength()

Public function Const

float

 

GetDeepShadowLayerDistribution()

Public function Const

FVector

 

GetDirection()

Public function Virtual Const

FVector2D

 

GetDirectionalLightDistanceFadeParameters

(
    ERHIFeatureLevel::Type InFeatureLev...,
    bool bPrecomputedLightingIsValid,
    int32 MaxNearCascades
)

Public function Virtual Const

float

 

GetEffectiveScreenRadius

(
    const FViewMatrices& ShadowViewMat...
)

Public function Virtual Const

float

 

GetFadeRange()

Public function Const

bool

 

GetForceCachedShadowsForMovablePrimitives()

Public function Const

UTextureLigh...

 

GetIESTexture()

Public function Const

FTexture ...

 

GetIESTextureResource()

Public function Const

float

 

GetIndirectLightingScale()

Public function Const

FName

 

GetLevelName()

Public function Const

const ULight...

 

GetLightComponent()

The Rendering thread must not dereference UObjects! The game thread owns UObject state and may be writing to them at any time.

Public function Const

float

 

GetLightFunctionDisabledBrightness()

Public function Const

float

 

GetLightFunctionFadeDistance()

Public function Const

const FMater...

 

GetLightFunctionMaterial()

Public function Const

FVector

 

GetLightFunctionScale()

Public function Const

FGuid

 

GetLightGuid()

Public function Const

uint8

 

GetLightingChannelMask()

Public function Virtual Const

FVector

 

GetLightPositionForLightShafts

(
    FVector ViewOrigin
)

Public function Const

FLightSceneI...

 

GetLightSceneInfo()

Public function Virtual Const

void

 

GetLightShaderParameters

(
    FLightShaderParameters& PathTracin...
)

Accesses parameters needed for rendering the light.

Public function Virtual Const

bool

 

GetLightShaftOcclusionParameters

(
    float& OutOcclusionMaskDarkness,
    float& OutOcclusionDepthRange
)

Public function Virtual Const

float

 

GetLightSourceAngle()

Public function Const

const FMatri...

 

GetLightToWorld()

Public function Const

uint8

 

GetLightType()

Public function Virtual Const

float

 

GetMaxDrawDistance()

Public function Const

FRHIUniformB...

 

GetMobileMovablePointLightUniformBufferRHI()

Public function Const

const FLinea...

 

GetModulatedShadowColor()

Public function Virtual Const

uint32

 

GetNumViewDependentWholeSceneShadows

(
    const FSceneView& View,
    bool bPrecomputedLightingIsValid
)

Returns the number of view dependent shadows this light will create, not counting distance field shadow cascades.

Public function Const

FVector

 

GetOrigin()

Public function Virtual Const

float

 

GetOuterConeAngle()

Public function Virtual Const

FLinearColor

 

GetOuterSpaceLuminance()

Public function Virtual Const

bool

 

GetPerObjectProjectedShadowInitializer

(
    const FBoxSphereBounds& SubjectBou...,
    FPerObjectProjectedShadowInitialize...
)

Sets up a projected shadow initializer for the given subject.

Public function Const

FVector4

 

GetPosition()

Public function Const

int32

 

GetPreviewShadowMapChannel()

Public function Virtual Const

float

 

GetRadius()

Public function Const

float

 

GetRayStartOffsetDepthScale()

Public function Const

uint32

 

GetSamplesPerPixel()

Public function Const

FSceneInterf...

 

GetSceneInterface()

Public function Virtual Const

bool

 

GetScissorRect

(
    FIntRect& ScissorRect,
    const FSceneView& View,
    const FIntRect& ViewRect
)

Public function Const

const float

 

GetShadowAmount()

Public function Const

int32

 

GetShadowMapChannel()

Public function Const

float

 

GetShadowResolutionScale()

Public function Const

float

 

GetShadowSharpen()

Public function Virtual Const

float

 

GetShadowSourceAngleFactor()

Public function Virtual Const

FSphere

 

GetShadowSplitBounds

(
    const FSceneView& View,
    int32 InCascadeIndex,
    bool bPrecomputedLightingIsValid,
    FShadowCascadeSettings* OutCas...
)

Public function Virtual Const

FSphere

 

GetShadowSplitBoundsDepthRange

(
    const FSceneView& View,
    FVector ViewOrigin,
    float SplitNear,
    float SplitFar,
    FShadowCascadeSettings* OutCas...
)

Public function Virtual Const

float

 

GetSourceRadius()

Public function Const

float

 

GetSpecularScale()

Public function Const

const FStati...

 

GetStaticShadowDepthMap()

Public function Const

TStatId

 

GetStatId()

Public function Virtual Const

float

 

GetSunLightHalfApexAngleRadian()

Public function Static

float

 

GetSunOnEarthHalfApexAngleRadian()

Public function Virtual Const

float

 

GetTraceDistance()

Public function Virtual Const

FLinearColor

 

GetTransmittanceFactor()

Public function Virtual Const

bool

 

GetUsePerPixelAtmosphereTransmittance()

Public function Const

float

 

GetUserShadowBias()

Accessors.

Public function Const

float

 

GetUserShadowSlopeBias()

Public function Virtual Const

bool

 

GetViewDependentRsmWholeSceneProjectedShadowInitializer

(
    const FSceneView& View,
    const FBox& LightPropagationVolume...,
    FWholeSceneProjectedShadowInitializ...
)

Sets up a projected shadow initializer for a reflective shadow map that's dependent on the current view for shadows from the entire scene.

Public function Virtual Const

bool

 

GetViewDependentWholeSceneProjectedShadowInitializer

(
    const FSceneView& View,
    int32 InCascadeIndex,
    bool bPrecomputedLightingIsValid,
    FWholeSceneProjectedShadowInitializ...
)

Sets up a projected shadow initializer that's dependent on the current view for shadows from the entire scene.

Public function Const

float

 

GetVolumetricScatteringIntensity()

Public function Virtual Const

bool

 

GetWholeSceneProjectedShadowInitializer

(
    const FSceneViewFamily& ViewFamily,
    TArray< class FWholeSceneProjectedS...
)

Sets up a projected shadow initializer for shadows from the entire scene.

Public function Const

const FMatri...

 

GetWorldToLight()

Public function Const

bool

 

HasReflectiveShadowMap()

Public function Virtual Const

bool

 

HasSourceTexture()

Public function Const

bool

 

HasStaticLighting()

Public function Const

bool

 

HasStaticShadowing()

Public function Const

bool

 

IsContactShadowLengthInWS()

Public function Virtual Const

bool

 

IsInverseSquared()

Public function Const

bool

 

IsMovable()

Public function Virtual Const

bool

 

IsRectLight()

Public function Const

bool

 

IsTiledDeferredLightingSupported()

Public function Const

bool

 

IsUsedAsAtmosphereSunLight()

Public function Const

bool

 

NeedsLPVInjection()

Public function Virtual

void

 

SetAtmosphereRelatedProperties

(
    FLinearColor TransmittanceFactor,
    FLinearColor SunOuterSpaceLuminance,
    bool bApplyAtmosphereTransmittanceT...
)

Protected function

void

 

SetColor

(
    const FLinearColor& InColor
)

Updates the light's color.

Public function

void

 

SetMobileMovablePointLightUniformBufferNeedsUpdate

(
    bool bInMobileMovablePointLightUnif...
)

Public function Virtual Const

bool

 

SetScissorRect

(
    FRHICommandList& RHICmdList,
    const FSceneView& View,
    const FIntRect& ViewRect,
    FIntRect* OutScissorRect
)

Protected function

void

 

SetTransform

(
    const FMatrix& InLightToWorld,
    const FVector4& InPosition
)

Updates the light proxy's cached transforms.

Public function Virtual Const

bool

 

ShouldCreatePerObjectShadowsForDynamicObjects()

Whether this light should create per object shadows for dynamic objects.

Public function Virtual Const

bool

 

ShouldCreateRayTracedCascade

(
    ERHIFeatureLevel::Type Type,
    bool bPrecomputedLightingIsValid,
    int32 MaxNearCascades
)

Public function Const

bool

 

Transmission()

Public function Virtual Const

bool

 

UseCSMForDynamicObjects()

Whether this light should create CSM for dynamic objects only (forward renderer)

Public function Const

bool

 

UseRayTracedDistanceFieldShadows()

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