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

Functions

FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixing (TEXT("r.ReflectionEnvironmentLightmapMixing"), GReflectionEnvironmentLightmapMixing, TEXT("Whether to mix indirect specular from reflection captures with indirect diffuse from lightmaps for rough surfaces."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixBasedOnRoughness (TEXT("r.ReflectionEnvironmentLightmapMixBasedOnRoughness"), GReflectionEnvironmentLightmapMixBasedOnRoughness, TEXT("Whether to reduce lightmap mixing with reflection captures for very smooth surfaces. This is useful to make sure reflection captures match SSR / planar reflections in brightness."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarReflectionEnvironmentBeginMixingRoughness (TEXT("r.ReflectionEnvironmentBeginMixingRoughness"), GReflectionEnvironmentBeginMixingRoughness, TEXT("Min roughness value at which to begin mixing reflection captures with lightmap indirect diffuse."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarReflectionEnvironmentEndMixingRoughness (TEXT("r.ReflectionEnvironmentEndMixingRoughness"), GReflectionEnvironmentEndMixingRoughness, TEXT("Min roughness value at which to end mixing reflection captures with lightmap indirect diffuse."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixLargestWeight (TEXT("r.ReflectionEnvironmentLightmapMixLargestWeight"), GReflectionEnvironmentLightmapMixLargestWeight, TEXT("When set to 1 can be used to clamp lightmap mixing such that only darkening from lightmaps are applied to reflection captures."), ECVF_Scalability|ECVF_RenderThreadSafe)
 
int GetReflectionEnvironmentCVar ()
 
FVector GetReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight ()
 
bool IsReflectionEnvironmentAvailable (ERHIFeatureLevel::Type InFeatureLevel)
 
bool IsReflectionCaptureAvailable ()
 
 IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT (ReflectionCapture)
 
 IMPLEMENT_STATIC_AND_SHADER_UNIFORM_BUFFER_STRUCT (FReflectionCaptureShaderData, "ReflectionCaptureSM5", ReflectionCapture)
 
 IMPLEMENT_STATIC_AND_SHADER_UNIFORM_BUFFER_STRUCT_EX (FMobileReflectionCaptureShaderData, "ReflectionCaptureES31", ReflectionCapture, FShaderParametersMetadata::EUsageFlags::NoEmulatedUniformBuffer)
 
void SetupSkyIrradianceEnvironmentMapConstantsFromSkyIrradiance (FVector4f *OutSkyIrradianceEnvironmentMap, const FSHVectorRGB3 SkyIrradiance)
 
void UpdateSkyIrradianceGpuBuffer (FRDGBuilder &GraphBuilder, const FEngineShowFlags &EngineShowFlags, const FSkyLightSceneProxy *SkyLight, TRefCountPtr< FRDGPooledBuffer > &Buffer)
 

Variables

int32 GReflectionEnvironmentLightmapMixing = 1
 
int32 GReflectionEnvironmentLightmapMixBasedOnRoughness = 1
 
float GReflectionEnvironmentBeginMixingRoughness = .1f
 
float GReflectionEnvironmentEndMixingRoughness = .3f
 
int32 GReflectionEnvironmentLightmapMixLargestWeight = 10000
 

Function Documentation

◆ CVarReflectionEnvironmentBeginMixingRoughness()

FAutoConsoleVariableRef CVarReflectionEnvironmentBeginMixingRoughness ( TEXT("r.ReflectionEnvironmentBeginMixingRoughness")  ,
GReflectionEnvironmentBeginMixingRoughness  ,
TEXT("Min roughness value at which to begin mixing reflection captures with lightmap indirect diffuse." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarReflectionEnvironmentEndMixingRoughness()

FAutoConsoleVariableRef CVarReflectionEnvironmentEndMixingRoughness ( TEXT("r.ReflectionEnvironmentEndMixingRoughness")  ,
GReflectionEnvironmentEndMixingRoughness  ,
TEXT("Min roughness value at which to end mixing reflection captures with lightmap indirect diffuse." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarReflectionEnvironmentLightmapMixBasedOnRoughness()

FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixBasedOnRoughness ( TEXT("r.ReflectionEnvironmentLightmapMixBasedOnRoughness")  ,
GReflectionEnvironmentLightmapMixBasedOnRoughness  ,
TEXT("Whether to reduce lightmap mixing with reflection captures for very smooth surfaces. This is useful to make sure reflection captures match SSR / planar reflections in brightness." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarReflectionEnvironmentLightmapMixing()

FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixing ( TEXT("r.ReflectionEnvironmentLightmapMixing")  ,
GReflectionEnvironmentLightmapMixing  ,
TEXT("Whether to mix indirect specular from reflection captures with indirect diffuse from lightmaps for rough surfaces." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ CVarReflectionEnvironmentLightmapMixLargestWeight()

FAutoConsoleVariableRef CVarReflectionEnvironmentLightmapMixLargestWeight ( TEXT("r.ReflectionEnvironmentLightmapMixLargestWeight")  ,
GReflectionEnvironmentLightmapMixLargestWeight  ,
TEXT("When set to 1 can be used to clamp lightmap mixing such that only darkening from lightmaps are applied to reflection captures." ,
ECVF_Scalability ECVF_RenderThreadSafe 
)

◆ GetReflectionEnvironmentCVar()

int GetReflectionEnvironmentCVar ( )

◆ GetReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight()

FVector GetReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight ( )

◆ IMPLEMENT_STATIC_AND_SHADER_UNIFORM_BUFFER_STRUCT()

IMPLEMENT_STATIC_AND_SHADER_UNIFORM_BUFFER_STRUCT ( FReflectionCaptureShaderData  ,
"ReflectionCaptureSM5"  ,
ReflectionCapture   
)

◆ IMPLEMENT_STATIC_AND_SHADER_UNIFORM_BUFFER_STRUCT_EX()

IMPLEMENT_STATIC_AND_SHADER_UNIFORM_BUFFER_STRUCT_EX ( FMobileReflectionCaptureShaderData  ,
"ReflectionCaptureES31"  ,
ReflectionCapture  ,
FShaderParametersMetadata::EUsageFlags::NoEmulatedUniformBuffer   
)

◆ IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT()

IMPLEMENT_STATIC_UNIFORM_BUFFER_SLOT ( ReflectionCapture  )

◆ IsReflectionCaptureAvailable()

bool IsReflectionCaptureAvailable ( )

◆ IsReflectionEnvironmentAvailable()

bool IsReflectionEnvironmentAvailable ( ERHIFeatureLevel::Type  InFeatureLevel)

◆ SetupSkyIrradianceEnvironmentMapConstantsFromSkyIrradiance()

void SetupSkyIrradianceEnvironmentMapConstantsFromSkyIrradiance ( FVector4f OutSkyIrradianceEnvironmentMap,
const FSHVectorRGB3  SkyIrradiance 
)

◆ UpdateSkyIrradianceGpuBuffer()

void UpdateSkyIrradianceGpuBuffer ( FRDGBuilder GraphBuilder,
const FEngineShowFlags EngineShowFlags,
const FSkyLightSceneProxy SkyLight,
TRefCountPtr< FRDGPooledBuffer > &  Buffer 
)

Variable Documentation

◆ GReflectionEnvironmentBeginMixingRoughness

float GReflectionEnvironmentBeginMixingRoughness = .1f

◆ GReflectionEnvironmentEndMixingRoughness

float GReflectionEnvironmentEndMixingRoughness = .3f

◆ GReflectionEnvironmentLightmapMixBasedOnRoughness

int32 GReflectionEnvironmentLightmapMixBasedOnRoughness = 1

◆ GReflectionEnvironmentLightmapMixing

int32 GReflectionEnvironmentLightmapMixing = 1

◆ GReflectionEnvironmentLightmapMixLargestWeight

int32 GReflectionEnvironmentLightmapMixLargestWeight = 10000