Files
UnrealEngineUWP/Engine/Shaders/ShadowDepthCommon.usf
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

44 lines
1.4 KiB
Plaintext

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ShadowDepthCommon.usf: Shared functionality for shadow depth rendering.
=============================================================================*/
#ifndef PERSPECTIVE_CORRECT_DEPTH
#define PERSPECTIVE_CORRECT_DEPTH 0
#endif
#ifndef REFLECTIVE_SHADOW_MAP
#define REFLECTIVE_SHADOW_MAP 0
#endif
#define INTERPOLATE_VF_ATTRIBUTES (!MATERIALBLENDING_SOLID || REFLECTIVE_SHADOW_MAP || MATERIALBLENDING_MASKED || (REQUIRES_VF_ATTRIBUTES_FOR_CLIPPING && !POSITION_ONLY))
#define INTERPOLATE_POSITION ((REFLECTIVE_SHADOW_MAP && !ONEPASS_POINTLIGHT_SHADOW) || MATERIALBLENDING_MASKED)
// x: Tweakable depth bias, y:InvMaxSubjectDepthUsed to normalize the outputted depth
float2 ShadowParams;
/** Data passed from the vertex shader to the pixel shader for the shadow depth pass. */
struct FShadowDepthVSToPS
{
#if INTERPOLATE_VF_ATTRIBUTES
FVertexFactoryInterpolantsVSToPS FactoryInterpolants;
#endif
#if ONEPASS_POINTLIGHT_SHADOW
float4 GSPosition : TEXCOORD6;
#elif PERSPECTIVE_CORRECT_DEPTH
float ShadowDepth : TEXCOORD6;
#elif !COMPILER_SUPPORTS_EMPTY_STRUCTS
float Dummy : TEXCOORD6;
#endif
#if INTERPOLATE_POSITION
// world space position needed in some cases, could be changed to be reconsructed from SvPosition (more tricky as this is not from camera perspective)
float3 PixelPosition : TEXCOORD7;
#endif
};