Files
UnrealEngineUWP/Engine/Shaders/ShadowProjectionVertexShader.usf
2014-03-14 14:13:41 -04:00

31 lines
938 B
Plaintext

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
ShadowProjectionVertexShader.usf: Vertex shader for projecting a shadow depth buffer onto the scene.
=============================================================================*/
#include "Common.usf"
#ifndef USE_TRANSFORM
#define USE_TRANSFORM 1
#endif
#if USE_TRANSFORM
float4 StencilingGeometryPosAndScale;
#endif
void Main(
in float4 InPosition : ATTRIBUTE0,
out float4 OutPosition : SV_POSITION
)
{
#if USE_TRANSFORM
// Transform geometry to clip space
float3 WorldPosition = InPosition * StencilingGeometryPosAndScale.w + StencilingGeometryPosAndScale.xyz;
OutPosition = mul(float4(WorldPosition,1),View.TranslatedWorldToClip);
#else
// Pass position straight through, as geometry is defined in clip space already.
OutPosition = float4(InPosition.xyz, 1);
#endif
}