UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ScreenSpaceShadows.cpp File Reference
#include "ScreenSpaceShadows.h"
#include "LightSceneInfo.h"
#include "LightSceneProxy.h"
#include "ShadowRendering.h"
#include "SceneRendering.h"
#include "RenderGraphUtils.h"
#include "PixelShaderUtils.h"
#include "bend_sss_cpu.h"

Classes

class  FScreenSpaceShadowsCS
 
class  FScreenSpaceShadowsBendCS
 
class  FScreenSpaceShadowsUpsamplePS
 

Enumerations

enum class  ContactShadowsMethod { StochasticJittering = 0 , BendSSS = 1 }
 
enum class  EContactShadowsIntensityMode { PrimitiveFlag , DepthBasedApproximation , ForceCastingIntensity , MAX }
 

Functions

void GetLightContactShadowParameters (const FLightSceneProxy *Proxy, float &OutLength, bool &bOutLengthInWS, float &OutCastingIntensity, float &OutNonCastingIntensity)
 
int32 GetScreenSpaceShadowDownsampleFactor ()
 
FIntPoint GetBufferSizeForScreenSpaceShadows (const FViewInfo &View)
 
 IMPLEMENT_GLOBAL_SHADER (FScreenSpaceShadowsCS, "/Engine/Private/ScreenSpaceShadows.usf", "ScreenSpaceShadowsCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FScreenSpaceShadowsBendCS, "/Engine/Private/ScreenSpaceShadows.usf", "ScreenSpaceShadowsBendCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FScreenSpaceShadowsUpsamplePS, "/Engine/Private/ScreenSpaceShadows.usf", "ScreenSpaceShadowsUpsamplePS", SF_Pixel)
 
void UpsampleScreenSpaceShadows (FRDGBuilder &GraphBuilder, const FMinimalSceneTextures &SceneTextures, const FViewInfo &View, FIntRect ScissorRect, bool bProjectingForForwardShading, const FLightSceneInfo *LightSceneInfo, FScreenPassTexture ShadowsTexture, int32 DownsampleFactor, FRDGTextureRef ScreenShadowMaskTexture)
 
void RenderScreenSpaceShadows (FRDGBuilder &GraphBuilder, bool bAsyncCompute, const FMinimalSceneTextures &SceneTextures, const FViewInfo &View, FIntRect ScissorRect, bool bProjectingForForwardShading, const FLightSceneInfo *LightSceneInfo, FRDGTextureRef ScreenShadowMaskTexture)
 
void RenderScreenSpaceShadowsBend (FRDGBuilder &GraphBuilder, bool bAsyncCompute, const FMinimalSceneTextures &SceneTextures, const FViewInfo &View, FIntRect ScissorRect, bool bProjectingForForwardShading, const FLightSceneInfo *LightSceneInfo, FRDGTextureRef ScreenShadowMaskTexture)
 
void RenderScreenSpaceShadows (FRDGBuilder &GraphBuilder, const FMinimalSceneTextures &SceneTextures, const TArray< FViewInfo > &Views, const FLightSceneInfo *LightSceneInfo, bool bProjectingForForwardShading, FRDGTextureRef ScreenShadowMaskTexture)
 

Variables

const int32 GScreenSpaceShadowsTileSizeX = 8
 
const int32 GScreenSpaceShadowsTileSizeY = 8
 

Enumeration Type Documentation

◆ ContactShadowsMethod

enum class ContactShadowsMethod
strong
Enumerator
StochasticJittering 
BendSSS 

◆ EContactShadowsIntensityMode

Enumerator
PrimitiveFlag 
DepthBasedApproximation 
ForceCastingIntensity 
MAX 

Function Documentation

◆ GetBufferSizeForScreenSpaceShadows()

FIntPoint GetBufferSizeForScreenSpaceShadows ( const FViewInfo View)

◆ GetLightContactShadowParameters()

void GetLightContactShadowParameters ( const FLightSceneProxy Proxy,
float OutLength,
bool bOutLengthInWS,
float OutCastingIntensity,
float OutNonCastingIntensity 
)
extern

◆ GetScreenSpaceShadowDownsampleFactor()

int32 GetScreenSpaceShadowDownsampleFactor ( )

◆ IMPLEMENT_GLOBAL_SHADER() [1/3]

IMPLEMENT_GLOBAL_SHADER ( FScreenSpaceShadowsBendCS  ,
"/Engine/Private/ScreenSpaceShadows.usf"  ,
"ScreenSpaceShadowsBendCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/3]

IMPLEMENT_GLOBAL_SHADER ( FScreenSpaceShadowsCS  ,
"/Engine/Private/ScreenSpaceShadows.usf"  ,
"ScreenSpaceShadowsCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [3/3]

IMPLEMENT_GLOBAL_SHADER ( FScreenSpaceShadowsUpsamplePS  ,
"/Engine/Private/ScreenSpaceShadows.usf"  ,
"ScreenSpaceShadowsUpsamplePS"  ,
SF_Pixel   
)

◆ RenderScreenSpaceShadows() [1/2]

void RenderScreenSpaceShadows ( FRDGBuilder GraphBuilder,
bool  bAsyncCompute,
const FMinimalSceneTextures SceneTextures,
const FViewInfo View,
FIntRect  ScissorRect,
bool  bProjectingForForwardShading,
const FLightSceneInfo LightSceneInfo,
FRDGTextureRef  ScreenShadowMaskTexture 
)

◆ RenderScreenSpaceShadows() [2/2]

void RenderScreenSpaceShadows ( FRDGBuilder GraphBuilder,
const FMinimalSceneTextures SceneTextures,
const TArray< FViewInfo > &  Views,
const FLightSceneInfo LightSceneInfo,
bool  bProjectingForForwardShading,
FRDGTextureRef  ScreenShadowMaskTexture 
)

◆ RenderScreenSpaceShadowsBend()

void RenderScreenSpaceShadowsBend ( FRDGBuilder GraphBuilder,
bool  bAsyncCompute,
const FMinimalSceneTextures SceneTextures,
const FViewInfo View,
FIntRect  ScissorRect,
bool  bProjectingForForwardShading,
const FLightSceneInfo LightSceneInfo,
FRDGTextureRef  ScreenShadowMaskTexture 
)

◆ UpsampleScreenSpaceShadows()

void UpsampleScreenSpaceShadows ( FRDGBuilder GraphBuilder,
const FMinimalSceneTextures SceneTextures,
const FViewInfo View,
FIntRect  ScissorRect,
bool  bProjectingForForwardShading,
const FLightSceneInfo LightSceneInfo,
FScreenPassTexture  ShadowsTexture,
int32  DownsampleFactor,
FRDGTextureRef  ScreenShadowMaskTexture 
)

Variable Documentation

◆ GScreenSpaceShadowsTileSizeX

const int32 GScreenSpaceShadowsTileSizeX = 8

◆ GScreenSpaceShadowsTileSizeY

const int32 GScreenSpaceShadowsTileSizeY = 8