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

Classes

class  FMegaLightsTileClassificationBuildListsCS
 
class  FInitTileIndirectArgsCS
 
struct  FMegaLightsFrameTemporaries
 

Namespaces

namespace  MegaLights
 
namespace  MegaLightsVolume
 
namespace  MegaLightsTranslucencyVolume
 

Functions

bool MegaLights::ShouldCompileShaders (EShaderPlatform ShaderPlatform)
 
bool MegaLights::IsRequested (const FSceneViewFamily &ViewFamily)
 
bool MegaLights::HasRequiredTracingData (const FSceneViewFamily &ViewFamily)
 
bool MegaLights::IsEnabled (const FSceneViewFamily &ViewFamily)
 
EPixelFormat MegaLights::GetLightingDataFormat ()
 
uint32 MegaLights::GetSampleMargin ()
 
bool MegaLights::UseVolume ()
 
bool MegaLights::UseTranslucencyVolume ()
 
bool MegaLights::IsTranslucencyVolumeSpatialFilterEnabled ()
 
bool MegaLights::IsTranslucencyVolumeTemporalFilterEnabled ()
 
bool MegaLights::IsMarkingVSMPages ()
 
bool MegaLights::IsUsingLightFunctions (const FSceneViewFamily &ViewFamily)
 
bool MegaLights::IsUsingLightingChannels ()
 
EMegaLightsMode MegaLights::GetMegaLightsMode (const FSceneViewFamily &ViewFamily, uint8 LightType, bool bLightAllowsMegaLights, TEnumAsByte< EMegaLightsShadowMethod::Type > ShadowMethod)
 
bool MegaLights::ShouldCompileShadersForReferenceMode (EShaderPlatform InPlatform)
 
uint32 MegaLights::GetReferenceShadingPassCount (EShaderPlatform InPlatform)
 
uint32 MegaLights::GetStateFrameIndex (FSceneViewState *ViewState, EShaderPlatform InPlatform)
 
FIntPoint MegaLights::GetDownsampleFactorXY (EMegaLightsInput InputType, EShaderPlatform ShaderPlatform)
 
FIntPoint MegaLights::GetDownsampleFactorXY (StochasticLighting::EMaterialSource MaterialSource, EShaderPlatform ShaderPlatform)
 
FIntPoint MegaLights::GetNumSamplesPerPixel2d (int32 NumSamplesPerPixel1d)
 
FIntPoint MegaLights::GetNumSamplesPerPixel2d (EMegaLightsInput InputType)
 
FIntVector MegaLights::GetNumSamplesPerVoxel3d (int32 NumSamplesPerVoxel1d)
 
int32 MegaLights::GetVisualizeLightLoopIterationsMode ()
 
int32 MegaLights::GetDebugMode (EMegaLightsInput InputType)
 
bool MegaLights::IsDebugEnabledForShadingPass (int32 ShadingPassIndex, EShaderPlatform InPlatform)
 
bool MegaLights::SupportsSpatialFilter (EMegaLightsInput InputType)
 
bool MegaLights::UseWaveOps (EShaderPlatform ShaderPlatform)
 
void MegaLights::ModifyCompilationEnvironment (EShaderPlatform Platform, FShaderCompilerEnvironment &OutEnvironment)
 
const TCHARMegaLights::GetTileTypeString (ETileType TileType)
 
bool MegaLights::IsRectLightTileType (ETileType TileType)
 
bool MegaLights::IsTexturedLightTileType (ETileType TileType)
 
bool MegaLights::IsComplexTileType (ETileType TileType)
 
TArray< int32MegaLights::GetShadingTileTypes (EMegaLightsInput InputType)
 
void MegaLights::SetupTileClassifyParameters (const FViewInfo &View, MegaLights::FTileClassifyParameters &OutParameters)
 
uint32 MegaLightsVolume::GetDownsampleFactor (EShaderPlatform ShaderPlatform)
 
FIntVector MegaLightsVolume::GetNumSamplesPerVoxel3d ()
 
bool MegaLightsVolume::UsesLightFunction ()
 
int32 MegaLightsVolume::GetDebugMode ()
 
uint32 MegaLightsTranslucencyVolume::GetDownsampleFactor (EShaderPlatform ShaderPlatform)
 
FIntVector MegaLightsTranslucencyVolume::GetNumSamplesPerVoxel3d ()
 
bool MegaLightsTranslucencyVolume::UsesLightFunction ()
 
int32 MegaLightsTranslucencyVolume::GetDebugMode ()
 
 IMPLEMENT_GLOBAL_SHADER (FMegaLightsTileClassificationBuildListsCS, "/Engine/Private/MegaLights/MegaLights.usf", "MegaLightsTileClassificationBuildListsCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FInitTileIndirectArgsCS, "/Engine/Private/MegaLights/MegaLights.usf", "InitTileIndirectArgsCS", SF_Compute)
 
 DECLARE_GPU_STAT (MegaLights)
 
int32 GetTranslucencyLightingVolumeDim ()
 
FIntVector GetVolumeResourceGridSize (const FViewInfo &View, int32 &OutGridPixelSize)
 
FIntVector GetVolumeViewGridSize (const FViewInfo &View, int32 &OutGridPixelSize)
 
FVector2f GetVolumeUVMaxForSampling (const FVector2f &ViewRectSize, FIntVector ResourceGridSize, int32 ResourceGridPixelSize)
 
FVector2f GetVolumePrevUVMaxForTemporalBlend (const FVector2f &ViewRectSize, FIntVector VolumeResourceGridSize, int32 VolumeResourceGridPixelSize)
 
FVector2f GetVolumeFroxelToScreenSVPosRatio (const FViewInfo &View)
 
void SetupMegaLightsVolumeData (const FViewInfo &View, bool bShouldRenderVolumetricFog, bool bShouldRenderTranslucencyVolume, FMegaLightsVolumeData &Parameters)
 
bool MegaLights::IsMissingDirectionalLightData (const FSceneViewFamily &ViewFamily)
 
bool MegaLights::HasWarning (const FSceneViewFamily &ViewFamily)
 
void MegaLights::WriteWarnings (const FSceneViewFamily &ViewFamily, FScreenMessageWriter &Writer)
 

Variables

int32 GMegaLightsReset = 0
 
FAutoConsoleVariableRef CVarMegaLightsReset (TEXT("r.MegaLights.Reset"), GMegaLightsReset, TEXT("Reset history for debugging."), ECVF_RenderThreadSafe)
 
int32 GMegaLightsResetEveryNthFrame = 0
 
FAutoConsoleVariableRef CVarMegaLightsResetEveryNthFrame (TEXT("r.MegaLights.ResetEveryNthFrame"), GMegaLightsResetEveryNthFrame, TEXT("Reset history every Nth frame for debugging."), ECVF_RenderThreadSafe)
 
int32 GMegaLightsDefaultShadowMethod = 0
 
FAutoConsoleVariableRef CMegaLightsDefaultShadowMethod (TEXT("r.MegaLights.DefaultShadowMethod"), GMegaLightsDefaultShadowMethod, TEXT("1 - Virtual Shadow Maps. Has a significant per light cost, but can cast shadows directly from the Nanite geometry using rasterization."), ECVF_RenderThreadSafe)
 
int32 GUseTranslucencyLightingVolumes
 
constexpr int32 MegaLights::TileSize = TILE_SIZE
 
constexpr int32 MegaLights::VisibleLightHashSize = VISIBLE_LIGHT_HASH_SIZE
 
constexpr int32 MegaLights::VisibleLightHashTileSize = VISIBLE_LIGHT_HASH_TILE_SIZE
 

Function Documentation

◆ DECLARE_GPU_STAT()

DECLARE_GPU_STAT ( MegaLights  )

◆ GetTranslucencyLightingVolumeDim()

int32 GetTranslucencyLightingVolumeDim ( )
extern

Function returning current translucency lighting volume dimensions.

◆ GetVolumeFroxelToScreenSVPosRatio()

FVector2f GetVolumeFroxelToScreenSVPosRatio ( const FViewInfo View)

◆ GetVolumePrevUVMaxForTemporalBlend()

FVector2f GetVolumePrevUVMaxForTemporalBlend ( const FVector2f ViewRectSize,
FIntVector  VolumeResourceGridSize,
int32  VolumeResourceGridPixelSize 
)

◆ GetVolumeResourceGridSize()

FIntVector GetVolumeResourceGridSize ( const FViewInfo View,
int32 OutGridPixelSize 
)

◆ GetVolumeUVMaxForSampling()

FVector2f GetVolumeUVMaxForSampling ( const FVector2f ViewRectSize,
FIntVector  ResourceGridSize,
int32  ResourceGridPixelSize 
)

◆ GetVolumeViewGridSize()

FIntVector GetVolumeViewGridSize ( const FViewInfo View,
int32 OutGridPixelSize 
)

◆ IMPLEMENT_GLOBAL_SHADER() [1/2]

IMPLEMENT_GLOBAL_SHADER ( FInitTileIndirectArgsCS  ,
"/Engine/Private/MegaLights/MegaLights.usf"  ,
"InitTileIndirectArgsCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/2]

IMPLEMENT_GLOBAL_SHADER ( FMegaLightsTileClassificationBuildListsCS  ,
"/Engine/Private/MegaLights/MegaLights.usf"  ,
"MegaLightsTileClassificationBuildListsCS"  ,
SF_Compute   
)

◆ SetupMegaLightsVolumeData()

void SetupMegaLightsVolumeData ( const FViewInfo View,
bool  bShouldRenderVolumetricFog,
bool  bShouldRenderTranslucencyVolume,
FMegaLightsVolumeData Parameters 
)

Variable Documentation

◆ CMegaLightsDefaultShadowMethod

FAutoConsoleVariableRef CMegaLightsDefaultShadowMethod(TEXT("r.MegaLights.DefaultShadowMethod"), GMegaLightsDefaultShadowMethod, TEXT("1 - Virtual Shadow Maps. Has a significant per light cost, but can cast shadows directly from the Nanite geometry using rasterization."), ECVF_RenderThreadSafe) ( TEXT("r.MegaLights.DefaultShadowMethod")  ,
GMegaLightsDefaultShadowMethod  ,
TEXT("1 - Virtual Shadow Maps. Has a significant per light cost, but can cast shadows directly from the Nanite geometry using rasterization." ,
ECVF_RenderThreadSafe   
)

◆ CVarMegaLightsReset

FAutoConsoleVariableRef CVarMegaLightsReset(TEXT("r.MegaLights.Reset"), GMegaLightsReset, TEXT("Reset history for debugging."), ECVF_RenderThreadSafe) ( TEXT("r.MegaLights.Reset")  ,
GMegaLightsReset  ,
TEXT("Reset history for debugging." ,
ECVF_RenderThreadSafe   
)

◆ CVarMegaLightsResetEveryNthFrame

FAutoConsoleVariableRef CVarMegaLightsResetEveryNthFrame(TEXT("r.MegaLights.ResetEveryNthFrame"), GMegaLightsResetEveryNthFrame, TEXT("Reset history every Nth frame for debugging."), ECVF_RenderThreadSafe) ( TEXT("r.MegaLights.ResetEveryNthFrame")  ,
GMegaLightsResetEveryNthFrame  ,
TEXT("Reset history every Nth frame for debugging." ,
ECVF_RenderThreadSafe   
)

◆ GMegaLightsDefaultShadowMethod

int32 GMegaLightsDefaultShadowMethod = 0

◆ GMegaLightsReset

int32 GMegaLightsReset = 0

◆ GMegaLightsResetEveryNthFrame

int32 GMegaLightsResetEveryNthFrame = 0

◆ GUseTranslucencyLightingVolumes

int32 GUseTranslucencyLightingVolumes
extern