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

Classes

class  FRenderSkyAtmosphereVS
 
class  FRenderSkyAtmospherePS
 
class  FRenderTransmittanceLutCS
 
class  FRenderMultiScatteredLuminanceLutCS
 
class  FRenderDistantSkyLightLutCS
 
class  FRenderSkyViewLutCS
 
class  FRenderCameraAerialPerspectiveVolumeCS
 
class  FRenderDebugSkyAtmospherePS
 
class  RenderSkyAtmosphereEditorHudPS
 
class  FUniformSphereSamplesBuffer
 

Macros

#define GET_VALID_DATA_FROM_CVAR
 
#define KM_TO_CM   100000.0f
 
#define CM_TO_KM   (1.0f / KM_TO_CM)
 
#define COPYMACRO(MemberName)   out.MemberName = Atmosphere.MemberName
 

Functions

 DECLARE_GPU_STAT (SkyAtmosphereLUTs)
 
 DECLARE_GPU_STAT (SkyAtmosphere)
 
 DECLARE_GPU_STAT (SkyAtmosphereEditor)
 
 DECLARE_GPU_STAT (SkyAtmosphereDebugVisualize)
 
 IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT (FAtmosphereUniformShaderParameters, "Atmosphere")
 
 IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT (FSkyAtmosphereInternalCommonParameters, "SkyAtmosphere")
 
 IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT (FSkyAtmosphereRealTimeReflectionLUTParameters, "SkyAtmosphereRealTimeReflectionLUTParameters")
 
auto GetDefaultSkyAtmosphereRealTimeReflectionLUTUniformBuffer ()
 
ESkyAtmospherePassLocation GetSkyAtmospherePassLocation ()
 
float GetValidAerialPerspectiveStartDepthInCm (const FViewInfo &View, const FSkyAtmosphereSceneProxy &SkyAtmosphereProxy)
 
bool ShouldSkySampleAtmosphereLightsOpaqueShadow (const FScene &Scene, const TArray< FVisibleLightInfo, SceneRenderingAllocator > &VisibleLightInfos, SkyAtmosphereLightShadowData &LightShadowData)
 
void GetSkyAtmosphereLightsUniformBuffers (FRDGBuilder &GraphBuilder, TRDGUniformBufferRef< FVolumeShadowingShaderParametersGlobal0 > &OutLightShadowShaderParams0UniformBuffer, TRDGUniformBufferRef< FVolumeShadowingShaderParametersGlobal1 > &OutLightShadowShaderParams1UniformBuffer, const SkyAtmosphereLightShadowData &LightShadowData, const FViewInfo &ViewInfo, const bool bShouldSampleOpaqueShadow, const EUniformBufferUsage UniformBufferUsage)
 
bool ShouldRenderSkyAtmosphere (const FScene *Scene, const FEngineShowFlags &EngineShowFlags)
 
void SetupSkyAtmosphereViewSharedUniformShaderParameters (const FViewInfo &View, const FSkyAtmosphereSceneProxy &SkyAtmosphereProxy, FSkyAtmosphereViewSharedUniformShaderParameters &OutParameters)
 
void PrepareSunLightProxy (const FSkyAtmosphereRenderSceneInfo &SkyAtmosphere, uint32 AtmosphereLightIndex, FLightSceneInfo &AtmosphereLight)
 
bool IsLightAtmospherePerPixelTransmittanceEnabled (const FScene *Scene, const FViewInfo &View, const FLightSceneInfo *const LightSceneInfo)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderSkyAtmosphereVS, "/Engine/Private/SkyAtmosphere.usf", "SkyAtmosphereVS", SF_Vertex)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderSkyAtmospherePS, "/Engine/Private/SkyAtmosphere.usf", "RenderSkyAtmosphereRayMarchingPS", SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderTransmittanceLutCS, "/Engine/Private/SkyAtmosphere.usf", "RenderTransmittanceLutCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderMultiScatteredLuminanceLutCS, "/Engine/Private/SkyAtmosphere.usf", "RenderMultiScatteredLuminanceLutCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderDistantSkyLightLutCS, "/Engine/Private/SkyAtmosphere.usf", "RenderDistantSkyLightLutCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderSkyViewLutCS, "/Engine/Private/SkyAtmosphere.usf", "RenderSkyViewLutCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderCameraAerialPerspectiveVolumeCS, "/Engine/Private/SkyAtmosphere.usf", "RenderCameraAerialPerspectiveVolumeCS", SF_Compute)
 
 IMPLEMENT_GLOBAL_SHADER (FRenderDebugSkyAtmospherePS, "/Engine/Private/SkyAtmosphere.usf", "RenderSkyAtmosphereDebugPS", SF_Pixel)
 
 IMPLEMENT_GLOBAL_SHADER (RenderSkyAtmosphereEditorHudPS, "/Engine/Private/SkyAtmosphere.usf", "RenderSkyAtmosphereEditorHudPS", SF_Pixel)
 
void InitSkyAtmosphereForScene (FRHICommandListImmediate &RHICmdList, FRDGBuilder &GraphBuilder, FScene *Scene)
 
void InitSkyAtmosphereForView (FRHICommandListImmediate &RHICmdList, const FScene *Scene, FViewInfo &View)
 
bool ShouldRenderSkyAtmosphereDebugPasses (const FScene *Scene, const FEngineShowFlags &EngineShowFlags)
 
FScreenPassTexture AddSkyAtmosphereDebugPasses (FRDGBuilder &GraphBuilder, FScene *Scene, const FSceneViewFamily &ViewFamily, const FViewInfo &View, FScreenPassTexture &ScreenPassSceneColor)
 

Variables

TGlobalResource< FUniformSphereSamplesBufferGUniformSphereSamplesBuffer
 

Macro Definition Documentation

◆ CM_TO_KM

#define CM_TO_KM   (1.0f / KM_TO_CM)

◆ COPYMACRO

#define COPYMACRO (   MemberName)    out.MemberName = Atmosphere.MemberName

◆ GET_VALID_DATA_FROM_CVAR

#define GET_VALID_DATA_FROM_CVAR
Value:
{ \
return Value < 4 ? 4 : Value; \
}; \
int32 TransmittanceLutWidth = ValidateLUTResolution(CVarSkyAtmosphereTransmittanceLUTWidth.GetValueOnRenderThread()); \
int32 TransmittanceLutHeight = ValidateLUTResolution(CVarSkyAtmosphereTransmittanceLUTHeight.GetValueOnRenderThread()); \
int32 MultiScatteredLuminanceLutWidth = ValidateLUTResolution(CVarSkyAtmosphereMultiScatteringLUTWidth.GetValueOnRenderThread()); \
int32 MultiScatteredLuminanceLutHeight = ValidateLUTResolution(CVarSkyAtmosphereMultiScatteringLUTHeight.GetValueOnRenderThread()); \
int32 SkyViewLutWidth = ValidateLUTResolution(CVarSkyAtmosphereFastSkyLUTWidth.GetValueOnRenderThread()); \
int32 SkyViewLutHeight = ValidateLUTResolution(CVarSkyAtmosphereFastSkyLUTHeight.GetValueOnRenderThread()); \
int32 CameraAerialPerspectiveVolumeDepthResolution = ValidateLUTResolution(CVarSkyAtmosphereAerialPerspectiveLUTDepthResolution.GetValueOnRenderThread()); \
float CameraAerialPerspectiveVolumeDepthKm = CVarSkyAtmosphereAerialPerspectiveLUTDepth.GetValueOnRenderThread(); \
float CameraAerialPerspectiveVolumeDepthSliceLengthKm = CameraAerialPerspectiveVolumeDepthKm / CameraAerialPerspectiveVolumeDepthResolution;
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
T GetValueOnRenderThread() const
Definition IConsoleManager.h:1849

◆ KM_TO_CM

#define KM_TO_CM   100000.0f

Function Documentation

◆ AddSkyAtmosphereDebugPasses()

FScreenPassTexture AddSkyAtmosphereDebugPasses ( FRDGBuilder GraphBuilder,
FScene Scene,
const FSceneViewFamily ViewFamily,
const FViewInfo View,
FScreenPassTexture ScreenPassSceneColor 
)

◆ DECLARE_GPU_STAT() [1/4]

DECLARE_GPU_STAT ( SkyAtmosphere  )

◆ DECLARE_GPU_STAT() [2/4]

DECLARE_GPU_STAT ( SkyAtmosphereDebugVisualize  )

◆ DECLARE_GPU_STAT() [3/4]

DECLARE_GPU_STAT ( SkyAtmosphereEditor  )

◆ DECLARE_GPU_STAT() [4/4]

DECLARE_GPU_STAT ( SkyAtmosphereLUTs  )

◆ GetDefaultSkyAtmosphereRealTimeReflectionLUTUniformBuffer()

auto GetDefaultSkyAtmosphereRealTimeReflectionLUTUniformBuffer ( )

◆ GetSkyAtmosphereLightsUniformBuffers()

void GetSkyAtmosphereLightsUniformBuffers ( FRDGBuilder GraphBuilder,
TRDGUniformBufferRef< FVolumeShadowingShaderParametersGlobal0 > &  OutLightShadowShaderParams0UniformBuffer,
TRDGUniformBufferRef< FVolumeShadowingShaderParametersGlobal1 > &  OutLightShadowShaderParams1UniformBuffer,
const SkyAtmosphereLightShadowData LightShadowData,
const FViewInfo ViewInfo,
const bool  bShouldSampleOpaqueShadow,
const EUniformBufferUsage  UniformBufferUsage 
)

◆ GetSkyAtmospherePassLocation()

ESkyAtmospherePassLocation GetSkyAtmospherePassLocation ( )

◆ GetValidAerialPerspectiveStartDepthInCm()

float GetValidAerialPerspectiveStartDepthInCm ( const FViewInfo View,
const FSkyAtmosphereSceneProxy SkyAtmosphereProxy 
)

◆ IMPLEMENT_GLOBAL_SHADER() [1/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderCameraAerialPerspectiveVolumeCS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderCameraAerialPerspectiveVolumeCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [2/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderDebugSkyAtmospherePS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderSkyAtmosphereDebugPS"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER() [3/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderDistantSkyLightLutCS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderDistantSkyLightLutCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [4/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderMultiScatteredLuminanceLutCS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderMultiScatteredLuminanceLutCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [5/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderSkyAtmospherePS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderSkyAtmosphereRayMarchingPS"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER() [6/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderSkyAtmosphereVS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"SkyAtmosphereVS"  ,
SF_Vertex   
)

◆ IMPLEMENT_GLOBAL_SHADER() [7/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderSkyViewLutCS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderSkyViewLutCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [8/9]

IMPLEMENT_GLOBAL_SHADER ( FRenderTransmittanceLutCS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderTransmittanceLutCS"  ,
SF_Compute   
)

◆ IMPLEMENT_GLOBAL_SHADER() [9/9]

IMPLEMENT_GLOBAL_SHADER ( RenderSkyAtmosphereEditorHudPS  ,
"/Engine/Private/SkyAtmosphere.usf"  ,
"RenderSkyAtmosphereEditorHudPS"  ,
SF_Pixel   
)

◆ IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT() [1/3]

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT ( FAtmosphereUniformShaderParameters  ,
"Atmosphere"   
)

◆ IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT() [2/3]

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT ( FSkyAtmosphereInternalCommonParameters  ,
"SkyAtmosphere"   
)

◆ IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT() [3/3]

IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT ( FSkyAtmosphereRealTimeReflectionLUTParameters  ,
"SkyAtmosphereRealTimeReflectionLUTParameters"   
)

◆ InitSkyAtmosphereForScene()

void InitSkyAtmosphereForScene ( FRHICommandListImmediate RHICmdList,
FRDGBuilder GraphBuilder,
FScene Scene 
)

◆ InitSkyAtmosphereForView()

void InitSkyAtmosphereForView ( FRHICommandListImmediate RHICmdList,
const FScene Scene,
FViewInfo View 
)

◆ IsLightAtmospherePerPixelTransmittanceEnabled()

bool IsLightAtmospherePerPixelTransmittanceEnabled ( const FScene Scene,
const FViewInfo View,
const FLightSceneInfo *const  LightSceneInfo 
)

◆ PrepareSunLightProxy()

void PrepareSunLightProxy ( const FSkyAtmosphereRenderSceneInfo SkyAtmosphere,
uint32  AtmosphereLightIndex,
FLightSceneInfo AtmosphereLight 
)

◆ SetupSkyAtmosphereViewSharedUniformShaderParameters()

void SetupSkyAtmosphereViewSharedUniformShaderParameters ( const FViewInfo View,
const FSkyAtmosphereSceneProxy SkyAtmosphereProxy,
FSkyAtmosphereViewSharedUniformShaderParameters OutParameters 
)

◆ ShouldRenderSkyAtmosphere()

bool ShouldRenderSkyAtmosphere ( const FScene Scene,
const FEngineShowFlags EngineShowFlags 
)

◆ ShouldRenderSkyAtmosphereDebugPasses()

bool ShouldRenderSkyAtmosphereDebugPasses ( const FScene Scene,
const FEngineShowFlags EngineShowFlags 
)

◆ ShouldSkySampleAtmosphereLightsOpaqueShadow()

bool ShouldSkySampleAtmosphereLightsOpaqueShadow ( const FScene Scene,
const TArray< FVisibleLightInfo, SceneRenderingAllocator > &  VisibleLightInfos,
SkyAtmosphereLightShadowData LightShadowData 
)

Variable Documentation

◆ GUniformSphereSamplesBuffer

TGlobalResource<FUniformSphereSamplesBuffer> GUniformSphereSamplesBuffer