You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#summary UV offsets are now correctly calculated. This was previously blocking shadow game [CL 2039548 by Joe Tidmarsh in Main branch]
59 lines
1.4 KiB
Plaintext
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 |