Files
UnrealEngine/Engine/Shaders/Private/RayTracing/CompositeSkyLightPS.usf
2025-05-18 13:04:45 +08:00

23 lines
710 B
HLSL

// Copyright Epic Games, Inc. All Rights Reserved.
#include "../Common.ush"
#include "../DeferredShadingCommon.ush"
#include "../SceneTextureParameters.ush"
Texture2D<float4> SkyLightTexture;
SamplerState SkyLightTextureSampler;
void CompositeSkyLightPS(
in noperspective float4 OutUVAndScreenPos : TEXCOORD0,
out float4 OutColor : SV_Target0
)
{
const float2 UV = OutUVAndScreenPos.xy;
FGBufferData GBufferData = GetGBufferDataFromSceneTextures(UV);
float3 Albedo = GBufferData.StoredBaseColor - GBufferData.StoredBaseColor * GBufferData.Metallic;
float4 SkyLight = SkyLightTexture.Sample(SkyLightTextureSampler, UV);
// Apply albedo after denoising
SkyLight.rgb *= Albedo;
OutColor = SkyLight;
}