Alright figured it out. It happens to be the placement of the UV output on my Vertex Shader. It had to be called before outPos to have an effect. Anyone know why this is the case? Why does the positioning of the inputs/outputs matter? So here is the corrected hlsl file.
//Created 2019 . MIT License
#include "/Engine/Private/Common.ush"
#include "/Engine/Private/ColorUtils.ush"
//VertexShader
void MainVS(
in float4 InPosition : ATTRIBUTE0,
in float2 InUV : ATTRIBUTE1,
out float2 OutUV : TEXCOORD0, // This needs to be before OutPos. Don't know why
out float4 OutPos : SV_POSITION
)
{
OutPos = InPosition;
OutUV.x = 1.0f-InUV.x;// X axis was inverted for me based on how I layed out my render quad
OutUV.y = InUV.y;
}
//Taken from "/Engine/Shaders/Private/SimpleElementPixelShader.usf"
MaterialFloat4 ColourTexture2DSample(Texture2D Tex, SamplerState Sampler, float2 UV)
{
//If you want to sample a particular mip level use SampleLevel
//If you want raw unfiltered pixel data use Tex.Load
MaterialFloat4 Sample = Tex.Sample(Sampler, UV);
#if SRGB_INPUT_TEXTURE && (FEATURE_LEVEL == FEATURE_LEVEL_ES2) // ES2 does not support sRGB sampling
Sample.rgb = Sample.rgb * Sample.rgb;
#endif
return Sample;
}
float4 MyColor;
Texture2D TextureParameter;
SamplerState TexMapSampler;
void MainPS(
in float2 InUV : TEXCOORD0,
out float4 OutColor : SV_Target0
)
{
float xSize, ySize;
float4 packedValue = ColourTexture2DSample(TextureParameter, TexMapSampler, InUV);
OutColor = MyColor * (1.0 - PSVariable.BlendFactor) + float4(packedValue.r, packedValue.g, packedValue.b,1.0) * PSVariable.BlendFactor;
//OutColor = float4(InUV.x, InUV.y, 0.0f, 1.0f); //Testing to see if UVs are imported correctly
}