UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SceneManagement.cpp File Reference

Functions

bool AreCompressedTransformsSupported ()
 
bool DoesPlatformSupportDistanceFields (const FStaticShaderPlatform Platform)
 
bool DoesPlatformSupportDistanceFieldShadowing (EShaderPlatform Platform)
 
bool DoesPlatformSupportDistanceFieldAO (EShaderPlatform Platform)
 
bool DoesProjectSupportDistanceFields ()
 
bool ShouldAllPrimitivesHaveDistanceField (EShaderPlatform ShaderPlatform)
 
bool ShouldCompileDistanceFieldShaders (EShaderPlatform ShaderPlatform)
 
 IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT (WorkingColorSpace)
 
 IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT (FWorkingColorSpaceShaderParameters, "WorkingColorSpace", WorkingColorSpace)
 
float ComputeBoundsScreenRadiusSquared (const FVector4 &BoundsOrigin, const float SphereRadius, const FVector4 &ViewOrigin, const FMatrix &ProjMatrix)
 
float ComputeBoundsScreenRadiusSquared (const FVector4 &Origin, const float SphereRadius, const FSceneView &View)
 
float ComputeBoundsScreenSize (const FVector4 &Origin, const float SphereRadius, const FSceneView &View)
 
float ComputeTemporalLODBoundsScreenSize (const FVector &Origin, const float SphereRadius, const FSceneView &View, int32 SampleIndex)
 
float ComputeBoundsScreenSize (const FVector4 &BoundsOrigin, const float SphereRadius, const FVector4 &ViewOrigin, const FMatrix &ProjMatrix)
 
float ComputeBoundsDrawDistance (const float ScreenSize, const float SphereRadius, const FMatrix &ProjMatrix)
 
int8 ComputeTemporalStaticMeshLOD (const FStaticMeshRenderData *RenderData, const FVector4 &Origin, const float SphereRadius, const FSceneView &View, int32 MinLOD, float FactorScale, int32 SampleIndex)
 
const FSceneViewGetLODView (const FSceneView &InView)
 
int8 ComputeStaticMeshLOD (const FStaticMeshRenderData *RenderData, const FVector4 &Origin, const float SphereRadius, const FSceneView &View, int32 MinLOD, float FactorScale)
 
FLODMask ComputeLODForMeshes (const TArray< class FStaticMeshBatchRelevance > &StaticMeshRelevances, const FSceneView &View, const FVector4 &Origin, float SphereRadius, int32 ForcedLODLevel, float &OutScreenRadiusSquared, int8 CurFirstLODIdx, float ScreenSizeScale, bool bDitheredLODTransition)
 
FLODMask ComputeLODForMeshes (const TArray< class FStaticMeshBatchRelevance > &StaticMeshRelevances, const FSceneView &View, const FVector4 &BoundsOrigin, float BoundsSphereRadius, float InstanceSphereRadius, int32 ForcedLODLevel, float &OutScreenRadiusSquared, int8 CurFirstLODIdx, float ScreenSizeScale)
 
void InitializeSharedSamplerStates ()
 
 IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT (FLightmapResourceClusterShaderParameters, "LightmapResourceCluster")
 
void GetLightmapClusterResourceParameters (ERHIFeatureLevel::Type FeatureLevel, const FLightmapClusterResourceInput &Input, const IAllocatedVirtualTexture *AllocatedVT, FLightmapResourceClusterShaderParameters &Parameters)
 
 IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT (FMobileReflectionCaptureShaderParameters, "MobileReflectionCapture")
 

Variables

TGlobalResource< FDefaultWorkingColorSpaceUniformBufferGDefaultWorkingColorSpaceUniformBuffer
 
FSharedSamplerStateWrap_WorldGroupSettings = NULL
 
FSharedSamplerStateClamp_WorldGroupSettings = NULL
 
TGlobalResource< FDefaultLightmapResourceClusterUniformBufferGDefaultLightmapResourceClusterUniformBuffer
 
TGlobalResource< FDefaultMobileReflectionCaptureUniformBufferGDefaultMobileReflectionCaptureUniformBuffer
 

Function Documentation

◆ AreCompressedTransformsSupported()

bool AreCompressedTransformsSupported ( )

◆ ComputeBoundsDrawDistance()

float ComputeBoundsDrawDistance ( const float  ScreenSize,
const float  SphereRadius,
const FMatrix ProjMatrix 
)

Computes the draw distance of a given sphere bounds in the given view with the specified screen size.

Parameters
ScreenSize- The screen size (as computed by ComputeBoundsScreenSize)
SphereRadius- Radius of the sphere to use to calculate screen coverage
ProjMatrix- The projection matrix used to scale screen size bounds
Returns
float - The draw distance calculated

◆ ComputeBoundsScreenRadiusSquared() [1/2]

float ComputeBoundsScreenRadiusSquared ( const FVector4 BoundsOrigin,
const float  SphereRadius,
const FVector4 ViewOrigin,
const FMatrix ProjMatrix 
)

Computes the screen radius squared of a given sphere bounds in the given view. This is used at runtime instead of ComputeBoundsScreenSize to avoid a square root.

Parameters
Origin- Origin of the bounds in world space
SphereRadius- Radius of the sphere to use to calculate screen coverage
ViewOrigin- The view origin involved in the calculation
ProjMatrix- The projection matrix of the view involved in the calculation
Returns
float - The screen size calculated

◆ ComputeBoundsScreenRadiusSquared() [2/2]

float ComputeBoundsScreenRadiusSquared ( const FVector4 Origin,
const float  SphereRadius,
const FSceneView View 
)

Computes the screen radius squared of a given sphere bounds in the given view. This is used at runtime instead of ComputeBoundsScreenSize to avoid a square root. It is a wrapper for the version below that does not take a FSceneView reference but parameters directly

Parameters
Origin- Origin of the bounds in world space
SphereRadius- Radius of the sphere to use to calculate screen coverage
View- The view to calculate the display factor for
Returns
float - The screen size calculated

◆ ComputeBoundsScreenSize() [1/2]

float ComputeBoundsScreenSize ( const FVector4 BoundsOrigin,
const float  SphereRadius,
const FVector4 ViewOrigin,
const FMatrix ProjMatrix 
)

Computes the screen size of a given sphere bounds in the given view. The screen size is the projected diameter of the bounding sphere of the model. i.e. 0.5 means half the screen's maximum dimension.

Parameters
BoundsOrigin- Origin of the bounds in world space
SphereRadius- Radius of the sphere to use to calculate screen coverage
ViewOrigin- The origin of the view to calculate the display factor for
ProjMatrix- The projection matrix used to scale screen size bounds
Returns
float - The screen size calculated

◆ ComputeBoundsScreenSize() [2/2]

float ComputeBoundsScreenSize ( const FVector4 Origin,
const float  SphereRadius,
const FSceneView View 
)

Computes the screen size of a given sphere bounds in the given view. The screen size is the projected diameter of the bounding sphere of the model. i.e. 0.5 means half the screen's maximum dimension.

Parameters
Origin- Origin of the bounds in world space
SphereRadius- Radius of the sphere to use to calculate screen coverage
View- The view to calculate the display factor for
Returns
float - The screen size calculated

◆ ComputeLODForMeshes() [1/2]

FLODMask ComputeLODForMeshes ( const TArray< class FStaticMeshBatchRelevance > &  StaticMeshRelevances,
const FSceneView View,
const FVector4 Origin,
float  SphereRadius,
float  InstanceSphereRadius,
int32  ForcedLODLevel,
float OutScreenRadiusSquared,
int8  CurFirstLODIdx,
float  ScreenSizeScale = 1.0f 
)

Computes the LOD to render for the list of static meshes in the given view.

Parameters
StaticMeshes- List of static meshes.
View- The view to render the LOD level for
Origin- Origin of the bounds of the primitive in world space
SphereRadius- Radius of the sphere bounds of the primitive in world space
InstanceSphereRadius- Radius of the sphere bounds for a single mesh instance in the primitive. If not 0.f then the return FLODMask will contain a range of LODs ready for LOD selection on the GPU

◆ ComputeLODForMeshes() [2/2]

FLODMask ComputeLODForMeshes ( const TArray< class FStaticMeshBatchRelevance > &  StaticMeshRelevances,
const FSceneView View,
const FVector4 Origin,
float  SphereRadius,
int32  ForcedLODLevel,
float OutScreenRadiusSquared,
int8  CurFirstLODIdx,
float  ScreenSizeScale = 1.0f,
bool  bDitheredLODTransition = true 
)

Computes the LOD to render for the list of static meshes in the given view.

Parameters
StaticMeshes- List of static meshes.
View- The view to render the LOD level for
Origin- Origin of the bounds of the primitive in world space
SphereRadius- Radius of the sphere bounds of the primitive in world space

◆ ComputeStaticMeshLOD()

int8 ComputeStaticMeshLOD ( const FStaticMeshRenderData RenderData,
const FVector4 Origin,
const float  SphereRadius,
const FSceneView View,
int32  MinLOD,
float  FactorScale = 1.0f 
)

Computes the LOD level for the given static meshes render data in the given view.

Parameters
RenderData- Render data for the mesh
Origin- Origin of the bounds of the mesh in world space
SphereRadius- Radius of the sphere to use to calculate screen coverage
View- The view to calculate the LOD level for
FactorScale- multiplied by the computed screen size before computing LOD

◆ ComputeTemporalLODBoundsScreenSize()

float ComputeTemporalLODBoundsScreenSize ( const FVector Origin,
const float  SphereRadius,
const FSceneView View,
int32  SampleIndex 
)

◆ ComputeTemporalStaticMeshLOD()

int8 ComputeTemporalStaticMeshLOD ( const FStaticMeshRenderData RenderData,
const FVector4 Origin,
const float  SphereRadius,
const FSceneView View,
int32  MinLOD,
float  FactorScale,
int32  SampleIndex 
)

Computes the LOD level for the given static meshes render data in the given view, for one of the two temporal LOD samples

Parameters
RenderData- Render data for the mesh
Origin- Origin of the bounds of the mesh in world space
SphereRadius- Radius of the sphere to use to calculate screen coverage
View- The view to calculate the LOD level for
FactorScale- multiplied by the computed screen size before computing LOD
SampleIndex- index (0 or 1) of the temporal sample to use

◆ DoesPlatformSupportDistanceFieldAO()

bool DoesPlatformSupportDistanceFieldAO ( EShaderPlatform  Platform)

◆ DoesPlatformSupportDistanceFields()

bool DoesPlatformSupportDistanceFields ( const FStaticShaderPlatform  Platform)

◆ DoesPlatformSupportDistanceFieldShadowing()

bool DoesPlatformSupportDistanceFieldShadowing ( EShaderPlatform  Platform)

◆ DoesProjectSupportDistanceFields()

bool DoesProjectSupportDistanceFields ( )

◆ GetLightmapClusterResourceParameters()

void GetLightmapClusterResourceParameters ( ERHIFeatureLevel::Type  FeatureLevel,
const FLightmapClusterResourceInput Input,
const IAllocatedVirtualTexture AllocatedVT,
FLightmapResourceClusterShaderParameters Parameters 
)

◆ GetLODView()

const FSceneView & GetLODView ( const FSceneView InView)

Will return the view to use taking into account VR which has 2 views

◆ IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT() [1/2]

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT ( FLightmapResourceClusterShaderParameters  ,
"LightmapResourceCluster"   
)

◆ IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT() [2/2]

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT ( FMobileReflectionCaptureShaderParameters  ,
"MobileReflectionCapture"   
)

◆ IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT()

IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT ( WorkingColorSpace  )

◆ IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT()

IMPLEMENT_STATIC_UNIFORM_BUFFER_STRUCT ( FWorkingColorSpaceShaderParameters  ,
"WorkingColorSpace"  ,
WorkingColorSpace   
)

◆ InitializeSharedSamplerStates()

void InitializeSharedSamplerStates ( )

Initializes the shared sampler states.

◆ ShouldAllPrimitivesHaveDistanceField()

bool ShouldAllPrimitivesHaveDistanceField ( EShaderPlatform  ShaderPlatform)

◆ ShouldCompileDistanceFieldShaders()

bool ShouldCompileDistanceFieldShaders ( EShaderPlatform  ShaderPlatform)

Variable Documentation

◆ Clamp_WorldGroupSettings

FSharedSamplerState* Clamp_WorldGroupSettings = NULL

Sampler state using Clamp addressing and taking filter mode from the world texture group.

◆ GDefaultLightmapResourceClusterUniformBuffer

TGlobalResource< FDefaultLightmapResourceClusterUniformBuffer > GDefaultLightmapResourceClusterUniformBuffer

Global uniform buffer containing the default precomputed lighting data.

◆ GDefaultMobileReflectionCaptureUniformBuffer

TGlobalResource<FDefaultMobileReflectionCaptureUniformBuffer> GDefaultMobileReflectionCaptureUniformBuffer

Global uniform buffer containing the default reflection data used in mobile renderer.

◆ GDefaultWorkingColorSpaceUniformBuffer

TGlobalResource<FDefaultWorkingColorSpaceUniformBuffer> GDefaultWorkingColorSpaceUniformBuffer

◆ Wrap_WorldGroupSettings

FSharedSamplerState* Wrap_WorldGroupSettings = NULL

Sampler state using Wrap addressing and taking filter mode from the world texture group.