Files
UnrealEngineUWP/Engine/Shaders/FilterVertexShader.usf
Ben Marsh 149375b14b Update copyright notices to 2015.
[CL 2379638 by Ben Marsh in Main branch]
2014-12-07 19:09:38 -05:00

59 lines
1.5 KiB
Plaintext

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
FilterVertexShader.usf: Filter vertex shader source.
=============================================================================*/
#include "Common.usf"
float4 SampleOffsets[(NUM_SAMPLES + 1) / 2];
#if (ES2_PROFILE || ES3_1_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