23 lines
710 B
HLSL
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;
|
|
}
|