UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MegaLights Namespace Reference

Classes

struct  FTraceStats
 

Enumerations

enum class  ETileType : uint8 {
  SimpleShading = TILE_MODE_SIMPLE_SHADING , ComplexShading = TILE_MODE_COMPLEX_SHADING , SimpleShading_Rect = TILE_MODE_SIMPLE_SHADING_RECT , ComplexShading_Rect = TILE_MODE_COMPLEX_SHADING_RECT ,
  SimpleShading_Rect_Textured = TILE_MODE_SIMPLE_SHADING_RECT_TEXTURED , ComplexShading_Rect_Textured = TILE_MODE_COMPLEX_SHADING_RECT_TEXTURED , SHADING_MAX_LEGACY = TILE_MODE_EMPTY , Empty = TILE_MODE_EMPTY ,
  MAX_LEGACY = TILE_MODE_MAX_LEGACY , SHADING_MIN_SUBSTRATE = TILE_MODE_SINGLE_SHADING , SingleShading = TILE_MODE_SINGLE_SHADING , ComplexSpecialShading = TILE_MODE_COMPLEX_SPECIAL_SHADING ,
  SingleShading_Rect = TILE_MODE_SINGLE_SHADING_RECT , ComplexSpecialShading_Rect = TILE_MODE_COMPLEX_SPECIAL_SHADING_RECT , SingleShading_Rect_Textured = TILE_MODE_SINGLE_SHADING_RECT_TEXTURED , ComplexSpecialShading_Rect_Textured = TILE_MODE_COMPLEX_SPECIAL_SHADING_RECT_TEXTURED ,
  SHADING_MAX_SUBSTRATE = TILE_MODE_MAX , MAX_SUBSTRATE = TILE_MODE_MAX
}
 
enum class  ECompactedTraceIndirectArgs { NumTracesDiv64 = 0 * sizeof(FRHIDispatchIndirectParameters) , NumTracesDiv32 = 1 * sizeof(FRHIDispatchIndirectParameters) , NumTraces = 2 * sizeof(FRHIDispatchIndirectParameters) , MAX = 3 }
 
enum class  EMaterialMode : uint8 { Disabled , AHS , RetraceAHS , MAX }
 

Functions

bool ShouldCompileShaders (EShaderPlatform ShaderPlatform)
 
bool IsRequested (const FSceneViewFamily &ViewFamily)
 
bool HasRequiredTracingData (const FSceneViewFamily &ViewFamily)
 
bool IsEnabled (const FSceneViewFamily &ViewFamily)
 
EPixelFormat GetLightingDataFormat ()
 
uint32 GetSampleMargin ()
 
bool UseVolume ()
 
bool UseTranslucencyVolume ()
 
bool IsTranslucencyVolumeSpatialFilterEnabled ()
 
bool IsTranslucencyVolumeTemporalFilterEnabled ()
 
bool IsMarkingVSMPages ()
 
bool IsUsingLightFunctions (const FSceneViewFamily &ViewFamily)
 
bool IsUsingLightingChannels ()
 
EMegaLightsMode GetMegaLightsMode (const FSceneViewFamily &ViewFamily, uint8 LightType, bool bLightAllowsMegaLights, TEnumAsByte< EMegaLightsShadowMethod::Type > ShadowMethod)
 
bool ShouldCompileShadersForReferenceMode (EShaderPlatform InPlatform)
 
uint32 GetReferenceShadingPassCount (EShaderPlatform InPlatform)
 
uint32 GetStateFrameIndex (FSceneViewState *ViewState, EShaderPlatform InPlatform)
 
FIntPoint GetDownsampleFactorXY (EMegaLightsInput InputType, EShaderPlatform ShaderPlatform)
 
FIntPoint GetDownsampleFactorXY (StochasticLighting::EMaterialSource MaterialSource, EShaderPlatform ShaderPlatform)
 
FIntPoint GetNumSamplesPerPixel2d (int32 NumSamplesPerPixel1d)
 
FIntPoint GetNumSamplesPerPixel2d (EMegaLightsInput InputType)
 
FIntVector GetNumSamplesPerVoxel3d (int32 NumSamplesPerVoxel1d)
 
int32 GetVisualizeLightLoopIterationsMode ()
 
int32 GetDebugMode (EMegaLightsInput InputType)
 
bool IsDebugEnabledForShadingPass (int32 ShadingPassIndex, EShaderPlatform InPlatform)
 
bool SupportsSpatialFilter (EMegaLightsInput InputType)
 
bool UseWaveOps (EShaderPlatform ShaderPlatform)
 
void ModifyCompilationEnvironment (EShaderPlatform Platform, FShaderCompilerEnvironment &OutEnvironment)
 
const TCHARGetTileTypeString (ETileType TileType)
 
bool IsRectLightTileType (ETileType TileType)
 
bool IsTexturedLightTileType (ETileType TileType)
 
bool IsComplexTileType (ETileType TileType)
 
TArray< int32GetShadingTileTypes (EMegaLightsInput InputType)
 
void SetupTileClassifyParameters (const FViewInfo &View, MegaLights::FTileClassifyParameters &OutParameters)
 
bool IsMissingDirectionalLightData (const FSceneViewFamily &ViewFamily)
 
bool HasWarning (const FSceneViewFamily &ViewFamily)
 
void WriteWarnings (const FSceneViewFamily &ViewFamily, FScreenMessageWriter &Writer)
 
bool IsUsingClosestHZB (const FSceneViewFamily &ViewFamily)
 
bool IsUsingGlobalSDF (const FSceneViewFamily &ViewFamily)
 
bool IsSoftwareRayTracingSupported (const FSceneViewFamily &ViewFamily)
 
bool IsHardwareRayTracingSupported (const FSceneViewFamily &ViewFamily)
 
bool UseHardwareRayTracing (const FSceneViewFamily &ViewFamily)
 
bool UseInlineHardwareRayTracing (const FSceneViewFamily &ViewFamily)
 
bool UseFarField (const FSceneViewFamily &ViewFamily)
 
bool UseSpatialFilter ()
 
bool UseTemporalFilter ()
 
float GetTemporalMaxFramesAccumulated ()
 
float GetSpatialFilterMaxDisocclusionFrames ()
 
void RayTraceLightSamples (const FSceneViewFamily &ViewFamily, const FViewInfo &View, int32 ViewIndex, FRDGBuilder &GraphBuilder, const FSceneTextures &SceneTextures, const FVirtualShadowMapArray *VirtualShadowMapArray, const TArrayView< FRDGTextureRef > NaniteShadingMasks, const FIntPoint SampleBufferSize, FRDGTextureRef LightSamples, FRDGTextureRef LightSampleRays, FIntVector VolumeSampleBufferSize, FRDGTextureRef VolumeLightSamples, FRDGTextureRef VolumeLightSampleRays, FIntVector TranslucencyVolumeSampleBufferSize, TArrayView< FRDGTextureRef > TranslucencyVolumeLightSamples, TArrayView< FRDGTextureRef > TranslucencyVolumeLightSampleRays, const FMegaLightsParameters &MegaLightsParameters, const FMegaLightsVolumeParameters &MegaLightsVolumeParameters, const FMegaLightsVolumeParameters &MegaLightsTranslucencyVolumeParameters, EMegaLightsInput InputType, bool bDebug)
 
void MarkVSMPages (const FViewInfo &View, int32 ViewIndex, FRDGBuilder &GraphBuilder, const FVirtualShadowMapArray &VirtualShadowMapArray, const FIntPoint SampleBufferSize, FRDGTextureRef LightSamples, FRDGTextureRef LightSampleRays, const FMegaLightsParameters &MegaLightsParameters, EMegaLightsInput InputType)
 
bool UseScreenTraces (EMegaLightsInput InputType)
 
bool UseHairScreenTraces (EMegaLightsInput InputType)
 
bool ShouldForceTwoSided ()
 
bool UseDistantScreenTraces (const FViewInfo &View, bool bUseFarField)
 
FCompactedTraceParameters CompactMegaLightsTraces (const FViewInfo &View, FRDGBuilder &GraphBuilder, const FIntPoint SampleBufferSize, FRDGTextureRef LightSamples, const FMegaLightsParameters &MegaLightsParameters, EMegaLightsInput InputType, bool bCompactForScreenSpaceTraces)
 
FCompactedTraceParameters CompactMegaLightsVolumeTraces (const FViewInfo &View, FRDGBuilder &GraphBuilder, const FIntVector VolumeSampleBufferSize, FRDGTextureRef VolumeLightSampleRays, const FMegaLightsParameters &MegaLightsParameters, const FMegaLightsVolumeParameters &MegaLightsVolumeParameters)
 
EMaterialMode GetMaterialMode ()
 
float GetDirectionalLightSampleRatio ()
 

Variables

constexpr int32 TileSize = TILE_SIZE
 
constexpr int32 VisibleLightHashSize = VISIBLE_LIGHT_HASH_SIZE
 
constexpr int32 VisibleLightHashTileSize = VISIBLE_LIGHT_HASH_TILE_SIZE
 

Enumeration Type Documentation

◆ ECompactedTraceIndirectArgs

Enumerator
NumTracesDiv64 
NumTracesDiv32 
NumTraces 
MAX 

◆ EMaterialMode

Enumerator
Disabled 
AHS 
RetraceAHS 
MAX 

◆ ETileType

Enumerator
SimpleShading 
ComplexShading 
SimpleShading_Rect 
ComplexShading_Rect 
SimpleShading_Rect_Textured 
ComplexShading_Rect_Textured 
SHADING_MAX_LEGACY 
Empty 
MAX_LEGACY 
SHADING_MIN_SUBSTRATE 
SingleShading 
ComplexSpecialShading 
SingleShading_Rect 
ComplexSpecialShading_Rect 
SingleShading_Rect_Textured 
ComplexSpecialShading_Rect_Textured 
SHADING_MAX_SUBSTRATE 
MAX_SUBSTRATE 

Function Documentation

◆ CompactMegaLightsTraces()

MegaLights::FCompactedTraceParameters MegaLights::CompactMegaLightsTraces ( const FViewInfo View,
FRDGBuilder GraphBuilder,
const FIntPoint  SampleBufferSize,
FRDGTextureRef  LightSamples,
const FMegaLightsParameters MegaLightsParameters,
EMegaLightsInput  InputType,
bool  bCompactForScreenSpaceTraces 
)

◆ CompactMegaLightsVolumeTraces()

MegaLights::FCompactedTraceParameters MegaLights::CompactMegaLightsVolumeTraces ( const FViewInfo View,
FRDGBuilder GraphBuilder,
const FIntVector  VolumeSampleBufferSize,
FRDGTextureRef  VolumeLightSampleRays,
const FMegaLightsParameters MegaLightsParameters,
const FMegaLightsVolumeParameters MegaLightsVolumeParameters 
)

◆ GetDebugMode()

int32 MegaLights::GetDebugMode ( EMegaLightsInput  InputType)

◆ GetDirectionalLightSampleRatio()

float MegaLights::GetDirectionalLightSampleRatio ( )

◆ GetDownsampleFactorXY() [1/2]

FIntPoint MegaLights::GetDownsampleFactorXY ( EMegaLightsInput  InputType,
EShaderPlatform  ShaderPlatform 
)

◆ GetDownsampleFactorXY() [2/2]

FIntPoint MegaLights::GetDownsampleFactorXY ( StochasticLighting::EMaterialSource  MaterialSource,
EShaderPlatform  ShaderPlatform 
)

◆ GetLightingDataFormat()

EPixelFormat MegaLights::GetLightingDataFormat ( )

◆ GetMaterialMode()

EMaterialMode MegaLights::GetMaterialMode ( )

◆ GetMegaLightsMode()

EMegaLightsMode MegaLights::GetMegaLightsMode ( const FSceneViewFamily ViewFamily,
uint8  LightType,
bool  bLightAllowsMegaLights,
TEnumAsByte< EMegaLightsShadowMethod::Type ShadowMethod 
)

◆ GetNumSamplesPerPixel2d() [1/2]

FIntPoint MegaLights::GetNumSamplesPerPixel2d ( EMegaLightsInput  InputType)

◆ GetNumSamplesPerPixel2d() [2/2]

FIntPoint MegaLights::GetNumSamplesPerPixel2d ( int32  NumSamplesPerPixel1d)

◆ GetNumSamplesPerVoxel3d()

FIntVector MegaLights::GetNumSamplesPerVoxel3d ( int32  NumSamplesPerVoxel1d)

◆ GetReferenceShadingPassCount()

uint32 MegaLights::GetReferenceShadingPassCount ( EShaderPlatform  InPlatform)

◆ GetSampleMargin()

uint32 MegaLights::GetSampleMargin ( )

◆ GetShadingTileTypes()

TArray< int32 > MegaLights::GetShadingTileTypes ( EMegaLightsInput  InputType)

◆ GetSpatialFilterMaxDisocclusionFrames()

float MegaLights::GetSpatialFilterMaxDisocclusionFrames ( )

◆ GetStateFrameIndex()

uint32 MegaLights::GetStateFrameIndex ( FSceneViewState ViewState,
EShaderPlatform  InPlatform 
)

◆ GetTemporalMaxFramesAccumulated()

float MegaLights::GetTemporalMaxFramesAccumulated ( )

◆ GetTileTypeString()

const TCHAR * MegaLights::GetTileTypeString ( ETileType  TileType)

◆ GetVisualizeLightLoopIterationsMode()

int32 MegaLights::GetVisualizeLightLoopIterationsMode ( )

◆ HasRequiredTracingData()

bool MegaLights::HasRequiredTracingData ( const FSceneViewFamily ViewFamily)

◆ HasWarning()

bool MegaLights::HasWarning ( const FSceneViewFamily ViewFamily)

◆ IsComplexTileType()

bool MegaLights::IsComplexTileType ( ETileType  TileType)

◆ IsDebugEnabledForShadingPass()

bool MegaLights::IsDebugEnabledForShadingPass ( int32  ShadingPassIndex,
EShaderPlatform  InPlatform 
)

◆ IsEnabled()

bool MegaLights::IsEnabled ( const FSceneViewFamily ViewFamily)

◆ IsHardwareRayTracingSupported()

bool MegaLights::IsHardwareRayTracingSupported ( const FSceneViewFamily ViewFamily)

◆ IsMarkingVSMPages()

bool MegaLights::IsMarkingVSMPages ( )

◆ IsMissingDirectionalLightData()

bool MegaLights::IsMissingDirectionalLightData ( const FSceneViewFamily ViewFamily)

◆ IsRectLightTileType()

bool MegaLights::IsRectLightTileType ( ETileType  TileType)

◆ IsRequested()

bool MegaLights::IsRequested ( const FSceneViewFamily ViewFamily)

◆ IsSoftwareRayTracingSupported()

bool MegaLights::IsSoftwareRayTracingSupported ( const FSceneViewFamily ViewFamily)

◆ IsTexturedLightTileType()

bool MegaLights::IsTexturedLightTileType ( ETileType  TileType)

◆ IsTranslucencyVolumeSpatialFilterEnabled()

bool MegaLights::IsTranslucencyVolumeSpatialFilterEnabled ( )

◆ IsTranslucencyVolumeTemporalFilterEnabled()

bool MegaLights::IsTranslucencyVolumeTemporalFilterEnabled ( )

◆ IsUsingClosestHZB()

bool MegaLights::IsUsingClosestHZB ( const FSceneViewFamily ViewFamily)

◆ IsUsingGlobalSDF()

bool MegaLights::IsUsingGlobalSDF ( const FSceneViewFamily ViewFamily)

◆ IsUsingLightFunctions()

bool MegaLights::IsUsingLightFunctions ( const FSceneViewFamily ViewFamily)

◆ IsUsingLightingChannels()

bool MegaLights::IsUsingLightingChannels ( )

◆ MarkVSMPages()

void MegaLights::MarkVSMPages ( const FViewInfo View,
int32  ViewIndex,
FRDGBuilder GraphBuilder,
const FVirtualShadowMapArray VirtualShadowMapArray,
const FIntPoint  SampleBufferSize,
FRDGTextureRef  LightSamples,
FRDGTextureRef  LightSampleRays,
const FMegaLightsParameters MegaLightsParameters,
EMegaLightsInput  InputType 
)

◆ ModifyCompilationEnvironment()

void MegaLights::ModifyCompilationEnvironment ( EShaderPlatform  Platform,
FShaderCompilerEnvironment OutEnvironment 
)

◆ RayTraceLightSamples()

void MegaLights::RayTraceLightSamples ( const FSceneViewFamily ViewFamily,
const FViewInfo View,
int32  ViewIndex,
FRDGBuilder GraphBuilder,
const FSceneTextures SceneTextures,
const FVirtualShadowMapArray VirtualShadowMapArray,
const TArrayView< FRDGTextureRef NaniteShadingMasks,
const FIntPoint  SampleBufferSize,
FRDGTextureRef  LightSamples,
FRDGTextureRef  LightSampleRays,
FIntVector  VolumeSampleBufferSize,
FRDGTextureRef  VolumeLightSamples,
FRDGTextureRef  VolumeLightSampleRays,
FIntVector  TranslucencyVolumeSampleBufferSize,
TArrayView< FRDGTextureRef TranslucencyVolumeLightSamples,
TArrayView< FRDGTextureRef TranslucencyVolumeLightSampleRays,
const FMegaLightsParameters MegaLightsParameters,
const FMegaLightsVolumeParameters MegaLightsVolumeParameters,
const FMegaLightsVolumeParameters MegaLightsTranslucencyVolumeParameters,
EMegaLightsInput  InputType,
bool  bDebug 
)

Ray trace light samples using a variety of tracing methods depending on the feature configuration.

◆ SetupTileClassifyParameters()

void MegaLights::SetupTileClassifyParameters ( const FViewInfo View,
MegaLights::FTileClassifyParameters &  OutParameters 
)

◆ ShouldCompileShaders()

bool MegaLights::ShouldCompileShaders ( EShaderPlatform  ShaderPlatform)

◆ ShouldCompileShadersForReferenceMode()

bool MegaLights::ShouldCompileShadersForReferenceMode ( EShaderPlatform  InPlatform)

◆ ShouldForceTwoSided()

bool MegaLights::ShouldForceTwoSided ( )

◆ SupportsSpatialFilter()

bool MegaLights::SupportsSpatialFilter ( EMegaLightsInput  InputType)

◆ UseDistantScreenTraces()

bool MegaLights::UseDistantScreenTraces ( const FViewInfo View,
bool  bUseFarField 
)

◆ UseFarField()

bool MegaLights::UseFarField ( const FSceneViewFamily ViewFamily)

◆ UseHairScreenTraces()

bool MegaLights::UseHairScreenTraces ( EMegaLightsInput  InputType)

◆ UseHardwareRayTracing()

bool MegaLights::UseHardwareRayTracing ( const FSceneViewFamily ViewFamily)

◆ UseInlineHardwareRayTracing()

bool MegaLights::UseInlineHardwareRayTracing ( const FSceneViewFamily ViewFamily)

◆ UseScreenTraces()

bool MegaLights::UseScreenTraces ( EMegaLightsInput  InputType)

◆ UseSpatialFilter()

bool MegaLights::UseSpatialFilter ( )

◆ UseTemporalFilter()

bool MegaLights::UseTemporalFilter ( )

◆ UseTranslucencyVolume()

bool MegaLights::UseTranslucencyVolume ( )

◆ UseVolume()

bool MegaLights::UseVolume ( )

◆ UseWaveOps()

bool MegaLights::UseWaveOps ( EShaderPlatform  ShaderPlatform)

◆ WriteWarnings()

void MegaLights::WriteWarnings ( const FSceneViewFamily ViewFamily,
FScreenMessageWriter Writer 
)

Variable Documentation

◆ TileSize

constexpr int32 MegaLights::TileSize = TILE_SIZE
constexpr

◆ VisibleLightHashSize

constexpr int32 MegaLights::VisibleLightHashSize = VISIBLE_LIGHT_HASH_SIZE
constexpr

◆ VisibleLightHashTileSize

constexpr int32 MegaLights::VisibleLightHashTileSize = VISIBLE_LIGHT_HASH_TILE_SIZE
constexpr