Files
UnrealEngineUWP/Engine/Shaders/FilterVertexShader.usf
Joe Tidmarsh c489d646df #ttp 316639 - UE4: RENDERING: DrawDenormalizedQuad should reuse static index and vertexbuffer
#summary UV offsets are now correctly calculated. This was previously blocking shadow game

[CL 2039548 by Joe Tidmarsh in Main branch]
2014-04-23 17:26:59 -04:00

59 lines
1.4 KiB
Plaintext

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
FilterVertexShader.usf: Filter vertex shader source.
=============================================================================*/
#include "Common.usf"
float4 SampleOffsets[(NUM_SAMPLES + 1) / 2];
#if ES2_PROFILE
void Main(
float4 InPosition : ATTRIBUTE0,
float2 UV : ATTRIBUTE1,
out float2 OutUV : TEXCOORD0,
out float2 OutOffsetUVs[NUM_SAMPLES] : TEXCOORD1,
out float4 OutPosition : SV_POSITION
)
{
DrawRectangle( InPosition, UV, OutPosition, UV);
int SampleIndex;
for(SampleIndex = 0;SampleIndex < NUM_SAMPLES - 1;SampleIndex += 2)
{
half4 OffsetUVUV = SampleOffsets[SampleIndex / 2];
OutOffsetUVs[ SampleIndex + 0 ] = UV.xy + OffsetUVUV.xy;
OutOffsetUVs[ SampleIndex + 1 ] = UV.xy + OffsetUVUV.wz;
}
if(SampleIndex < NUM_SAMPLES)
{
half4 OffsetUVUV = SampleOffsets[SampleIndex / 2];
OutOffsetUVs[SampleIndex] = UV.xy + OffsetUVUV.xy;
}
OutUV = UV;
}
#else
void Main(
float4 InPosition : ATTRIBUTE0,
float2 UV : ATTRIBUTE1,
out float2 OutUV : TEXCOORD0,
out float4 OutOffsetUVs[(NUM_SAMPLES + 1) / 2] : TEXCOORD1,
out float4 OutPosition : SV_POSITION
)
{
DrawRectangle( InPosition, UV, OutPosition, UV);
for(int OffsetIndex = 0;OffsetIndex < (NUM_SAMPLES + 1) / 2;OffsetIndex++)
{
OutOffsetUVs[OffsetIndex] = UV.xyyx + SampleOffsets[OffsetIndex];
}
OutUV = UV;
}
#endif