![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "CoreMinimal.h"#include "Stats/Stats.h"#include "HAL/IConsoleManager.h"#include "RHI.h"#include "UniformBuffer.h"#include "ShaderParameters.h"#include "RendererInterface.h"#include "EngineDefines.h"#include "PrimitiveSceneProxy.h"#include "Shader.h"#include "SceneUtils.h"#include "PostProcess/SceneRenderTargets.h"#include "LightSceneInfo.h"#include "RectLightSceneProxy.h"#include "GlobalShader.h"#include "SceneRendering.h"#include "DeferredShadingRenderer.h"#include "BasePassRendering.h"#include "RendererModule.h"#include "ScenePrivate.h"#include "ClearQuad.h"#include "VolumetricFog.h"#include "VolumetricCloudRendering.h"#include "Components/LightComponent.h"#include "Engine/MapBuildDataRegistry.h"#include "PixelShaderUtils.h"#include "ShaderPrint.h"#include "ShaderPrintParameters.h"#include "RenderUtils.h"#include "MegaLights/MegaLights.h"#include "LightGridDefinitions.h"#include "LightViewData.h"Classes | |
| class | FLightGridInjectionCS |
| struct | FLightGrid |
| class | FDebugLightGridPS |
| class | FLightGridFeedbackStatusCS |
| class | FLightGridFeedbackStatus |
Typedefs | |
| typedef uint16 | FLightIndexType |
| typedef uint32 | FLightIndexType32 |
Enumerations | |
| enum class | ELightBufferMode { VisibleLocalLights = 0 , VisibleLights = 1 , VisibleLightsStableIndices = 2 } |
|
strong |
| FScreenPassTexture AddVisualizeLightGridPass | ( | FRDGBuilder & | GraphBuilder, |
| const FViewInfo & | View, | ||
| FScreenPassTexture | ScreenPassSceneColor, | ||
| FScreenPassTexture | SceneDepthTexture | ||
| ) |
| TRDGUniformBufferRef< FForwardLightUniformParameters > CreateDummyForwardLightUniformBuffer | ( | FRDGBuilder & | GraphBuilder, |
| EShaderPlatform | ShaderPlatform | ||
| ) |
| FAutoConsoleVariableRef CVarLightGridHZBCull | ( | TEXT("r.Forward.LightGridHZBCull") | , |
| GLightGridHZBCull | , | ||
| TEXT("Whether to use HZB culling to skip occluded grid cells.") | , | ||
| ECVF_Scalability| | ECVF_RenderThreadSafe | ||
| ) |
| FAutoConsoleVariableRef CVarLightGridPixelSize | ( | TEXT("r.Forward.LightGridPixelSize") | , |
| GLightGridPixelSize | , | ||
| TEXT("Size of a cell in the light grid, in pixels.") | , | ||
| ECVF_Scalability| | ECVF_RenderThreadSafe | ||
| ) |
| FAutoConsoleVariableRef CVarLightGridSizeZ | ( | TEXT("r.Forward.LightGridSizeZ") | , |
| GLightGridSizeZ | , | ||
| TEXT("Number of Z slices in the light grid.") | , | ||
| ECVF_Scalability| | ECVF_RenderThreadSafe | ||
| ) |
| FAutoConsoleVariableRef CVarLightLinkedListCulling | ( | TEXT("r.Forward.LightLinkedListCulling") | , |
| GLightLinkedListCulling | , | ||
| TEXT("Uses a reverse linked list to store culled lights, removing the fixed limit on how many lights can affect a cell - it becomes a global limit instead.") | , | ||
| ECVF_Scalability| | ECVF_RenderThreadSafe | ||
| ) |
| FAutoConsoleVariableRef CVarMaxCulledLightsPerCell | ( | TEXT("r.Forward.MaxCulledLightsPerCell") | , |
| GMaxCulledLightsPerCell | , | ||
| TEXT("Controls how much memory is allocated for each cell for light culling. When r.Forward.LightLinkedListCulling is enabled, this is used to compute a global max instead of a per-cell limit on culled lights.") | , | ||
| ECVF_Scalability| | ECVF_RenderThreadSafe | ||
| ) |
| DECLARE_GPU_STAT | ( | LightGrid | ) |
| FORCEINLINE float GetTanRadAngleOrZero | ( | float | coneAngle | ) |
| IMPLEMENT_GLOBAL_SHADER | ( | FDebugLightGridPS | , |
| "/Engine/Private/LightGridInjection.usf" | , | ||
| "DebugLightGridPS" | , | ||
| SF_Pixel | |||
| ) |
| IMPLEMENT_GLOBAL_SHADER | ( | FLightGridFeedbackStatusCS | , |
| "/Engine/Private/LightGridInjection.usf" | , | ||
| "FeedbackStatusCS" | , | ||
| SF_Compute | |||
| ) |
| IMPLEMENT_GLOBAL_SHADER | ( | FLightGridInjectionCS | , |
| "/Engine/Private/LightGridInjection.usf" | , | ||
| "LightGridInjectionCS" | , | ||
| SF_Compute | |||
| ) |
| IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT | ( | FForwardLightUniformParameters | , |
| "ForwardLightStruct" | |||
| ) |
| void LightGridFeedbackStatus | ( | FRDGBuilder & | GraphBuilder, |
| FViewInfo & | View, | ||
| FRDGBufferRef | CulledLightDataAllocatorBuffer, | ||
| uint32 | NumCulledLightDataEntries, | ||
| FRDGBufferRef | CulledLightLinkAllocatorBuffer, | ||
| uint32 | NumCulledLightLinks, | ||
| bool | bUseAsyncCompute | ||
| ) |
| FLightGrid LightGridInjection | ( | FRDGBuilder & | GraphBuilder, |
| FViewInfo & | View, | ||
| FIntVector | GridSize, | ||
| uint32 | LightGridPixelSizeShift, | ||
| uint32 | ZSliceScale, | ||
| uint32 | MaxNumCells, | ||
| FVector3f | ZParams, | ||
| uint32 | LightGridCullMarginXY, | ||
| uint32 | LightGridCullMarginZ, | ||
| FVector3f | LightGridCullMarginZParams, | ||
| uint32 | LightGridCullMaxZ, | ||
| uint32 | NumLocalLights, | ||
| uint32 | NumReflectionCaptures, | ||
| uint32 | MegaLightsSupportedStartIndex, | ||
| bool | bUse16BitBuffers, | ||
| bool | bRefineRectLightBounds, | ||
| FRDGBufferSRVRef | LightViewSpacePositionAndRadiusSRV, | ||
| FRDGBufferSRVRef | LightViewSpaceDirAndPreprocAngleSRV, | ||
| FRDGBufferSRVRef | LightViewSpaceRectPlanesSRV, | ||
| FRDGBufferSRVRef | IndirectionIndicesSRV, | ||
| bool | bThreadGroupPerCell, | ||
| bool | bThreadGroupSize32, | ||
| FRDGBufferSRVRef | ParentNumCulledLightsGridSRV, | ||
| FRDGBufferSRVRef | ParentCulledLightDataGridSRV, | ||
| uint32 | ParentGridSizeFactor | ||
| ) |
| bool LightGridUses16BitBuffers | ( | EShaderPlatform | Platform | ) |
| void SetDummyForwardLightUniformBufferOnViews | ( | FRDGBuilder & | GraphBuilder, |
| EShaderPlatform | ShaderPlatform, | ||
| TArray< FViewInfo > & | Views | ||
| ) |
| void SetupDummyForwardLightUniformParameters | ( | FRDGBuilder & | GraphBuilder, |
| FForwardLightUniformParameters & | ForwardLightUniformParameters, | ||
| EShaderPlatform | ShaderPlatform | ||
| ) |
| bool ShouldVisualizeLightGrid | ( | EShaderPlatform | InShaderPlatform | ) |
| FAutoConsoleVariableRef CVarLightCullingMaxDistanceOverride(TEXT("r.LightCulling.MaxDistanceOverrideKilometers"), GLightCullingMaxDistanceOverrideKilometers, TEXT(" >0: the far distance in kilometers.\n"), ECVF_RenderThreadSafe) | ( | TEXT("r.LightCulling.MaxDistanceOverrideKilometers") | , |
| GLightCullingMaxDistanceOverrideKilometers | , | ||
| TEXT(" >0: the far distance in kilometers.\n") | , | ||
| ECVF_RenderThreadSafe | |||
| ) |
| FAutoConsoleVariableRef CVarLightCullingQuality(TEXT("r.LightCulling.Quality"), GLightCullingQuality, TEXT(" 1: on (default)\n"), ECVF_RenderThreadSafe) | ( | TEXT("r.LightCulling.Quality") | , |
| GLightCullingQuality | , | ||
| TEXT(" 1: on (default)\n") | , | ||
| ECVF_RenderThreadSafe | |||
| ) |
| FAutoConsoleVariableRef CVarLightGridDebug(TEXT("r.Forward.LightGridDebug"), GForwardLightGridDebug, TEXT(" 3: on - showing max light count per tile accoung for each slice and the last one \n"), ECVF_RenderThreadSafe) | ( | TEXT("r.Forward.LightGridDebug") | , |
| GForwardLightGridDebug | , | ||
| TEXT(" 3: on - showing max light count per tile accoung for each slice and the last one \n") | , | ||
| ECVF_RenderThreadSafe | |||
| ) |
| FAutoConsoleVariableRef CVarLightGridDebugMaxThreshold(TEXT("r.Forward.LightGridDebug.MaxThreshold"), GForwardLightGridDebugMaxThreshold, TEXT("Maximum light threshold for heat map visualization. (default = 8)\n"), ECVF_RenderThreadSafe) | ( | TEXT("r.Forward.LightGridDebug.MaxThreshold") | , |
| GForwardLightGridDebugMaxThreshold | , | ||
| TEXT("Maximum light threshold for heat map visualization. (default = 8)\n") | , | ||
| ECVF_RenderThreadSafe | |||
| ) |
| FAutoConsoleVariableRef CVarLightGridRefineRectLightBounds(TEXT("r.Forward.LightGridDebug.RectLightBounds"), GLightGridRefineRectLightBounds, TEXT("Whether to refine rect light bounds (should only be disabled for debugging purposes)."), ECVF_RenderThreadSafe) | ( | TEXT("r.Forward.LightGridDebug.RectLightBounds") | , |
| GLightGridRefineRectLightBounds | , | ||
| TEXT("Whether to refine rect light bounds (should only be disabled for debugging purposes).") | , | ||
| ECVF_RenderThreadSafe | |||
| ) |
| int32 GForwardLightGridDebug = 0 |
| int32 GForwardLightGridDebugMaxThreshold = 8 |
| float GLightCullingMaxDistanceOverrideKilometers = -1.0f |
| int32 GLightCullingQuality = 1 |
| TGlobalResource<FLightGridFeedbackStatus> GLightGridFeedbackStatus |
| int32 GLightGridHZBCull = 1 |
| int32 GLightGridPixelSize = 64 |
| int32 GLightGridRefineRectLightBounds = 1 |
| int32 GLightGridSizeZ = 32 |
| int32 GLightLinkedListCulling = 1 |
| int32 GMaxCulledLightsPerCell = 32 |
| int32 LightLinkStride = 2 |
| int32 NumCulledGridPrimitiveTypes = 2 |
| int32 NumCulledLightsGridStride = 2 |