#line 1 "unknown"

#line 1 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\TiltShift.fx"
#line 1 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\ReShadeUI.fxh"
#line 16 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\TiltShift.fx"
#line 18
uniform bool Line <
ui_label = "Show Center Line";
> = false;
#line 22
uniform int Axis <        ui_type = "slider"; 
ui_label = "Angle";
#line 27
ui_min = -89; ui_max = 90;
> = 0;
#line 30
uniform float Offset <      ui_type = "slider"; 
ui_min = -1.41; ui_max = 1.41; ui_step = 0.01;
> = 0.05;
#line 34
uniform float BlurCurve <      ui_type = "slider"; 
ui_label = "Blur Curve";
ui_min = 1.0; ui_max = 5.0; ui_step = 0.01;
ui_label = "Blur Curve";
> = 1.0;
#line 40
uniform float BlurMultiplier <      ui_type = "slider"; 
ui_label = "Blur Multiplier";
ui_min = 0.0; ui_max = 100.0; ui_step = 0.2;
> = 6.0;
#line 45
uniform int BlurSamples <        ui_type = "slider"; 
ui_label = "Blur Samples";
ui_min = 2; ui_max = 32;
> = 11;
#line 51
texture TiltShiftTarget < pooled = true; > { Width = 2464; Height = 1468; Format = RGBA8; };
sampler TiltShiftSampler { Texture = TiltShiftTarget; };
#line 62
float get_weight(float t)
{
float bottom = min(t, 0.5);
float top = max(t, 0.5);
return 2.0 *(bottom*bottom +top +top -top*top) -1.5;
}
#line 1 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\ReShade.fxh"
#line 50
namespace ReShade
{
#line 61
static const float AspectRatio = 2464 * (1.0 / 1468);
static const float2 PixelSize = float2((1.0 / 2464), (1.0 / 1468));
static const float2 ScreenSize = float2(2464, 1468);
#line 67
texture BackBufferTex : COLOR;
texture DepthBufferTex : DEPTH;
#line 70
sampler BackBuffer { Texture = BackBufferTex; };
sampler DepthBuffer { Texture = DepthBufferTex; };
#line 74
float GetLinearizedDepth(float2 texcoord)
{
#line 79
texcoord.x /=  1;
texcoord.y /=  1;
#line 84
texcoord.x -=  0 / 2.000000001;
#line 89
texcoord.y +=  0 / 2.000000001;
#line 91
float depth = tex2Dlod(DepthBuffer, float4(texcoord, 0, 0)).x *  1;
#line 100
const float N = 1.0;
depth /= 1000.0 - depth * (1000.0 - N);
#line 103
return depth;
}
}
#line 108
void PostProcessVS(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD)
{
texcoord.x = (id == 2) ? 2.0 : 0.0;
texcoord.y = (id == 1) ? 2.0 : 0.0;
position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}
#line 73 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\TiltShift.fx"
#line 75
void TiltShiftPass1PS(float4 vpos : SV_Position, float2 UvCoord : TEXCOORD, out float4 Image : SV_Target)
{
#line 78
Image.rgb = tex2D(ReShade::BackBuffer, UvCoord).rgb;
#line 80
float2 UvCoordAspect = UvCoord;
UvCoordAspect.y +=  (2464 * (1.0 / 1468)) * 0.5 - 0.5;
UvCoordAspect.y /=  (2464 * (1.0 / 1468));
#line 84
UvCoordAspect = UvCoordAspect * 2.0 - 1.0;
#line 86
float Angle = radians(-Axis);
float2 TiltVector = float2(sin(Angle), cos(Angle));
#line 89
float BlurMask = abs(dot(TiltVector, UvCoordAspect) + Offset);
BlurMask = max(0.0, min(1.0, BlurMask));
#line 92
Image.a = BlurMask;
BlurMask = pow(Image.a, BlurCurve);
#line 96
if(BlurMask > 0)
{
#line 99
float UvOffset =  float2((1.0 / 2464), (1.0 / 1468)).x *BlurMask *BlurMultiplier;
#line 101
float total_weight = 0.5;
#line 103
for (int i=1; i<BlurSamples; i++)
{
#line 106
float current_sample = float(i)/float(BlurSamples);
#line 108
float current_weight = get_weight(1.0-current_sample);
#line 110
total_weight += current_weight;
#line 112
float SampleOffset = current_sample*11.0 * UvOffset; 
#line 114
Image.rgb += (
tex2Dlod( ReShade::BackBuffer, float4(float2(UvCoord.x+SampleOffset, UvCoord.y), 0.0, 0.0) ).rgb
+tex2Dlod( ReShade::BackBuffer, float4(float2(UvCoord.x-SampleOffset, UvCoord.y), 0.0, 0.0) ).rgb
) *current_weight;
}
#line 120
Image.rgb /= total_weight*2.0;
}
}
#line 124
void TiltShiftPass2PS(float4 vpos : SV_Position, float2 UvCoord : TEXCOORD, out float4 Image : SV_Target)
{
#line 127
Image = tex2D(TiltShiftSampler, UvCoord);
#line 129
float BlurMask = pow(abs(Image.a), BlurCurve);
#line 131
if(BlurMask > 0)
{
#line 134
float UvOffset =  float2((1.0 / 2464), (1.0 / 1468)).y *BlurMask *BlurMultiplier;
#line 136
float total_weight = 0.5;
#line 138
for (int i=1; i<BlurSamples; i++)
{
#line 141
float current_sample = float(i)/float(BlurSamples);
#line 143
float current_weight = get_weight(1.0-current_sample);
#line 145
total_weight += current_weight;
#line 147
float SampleOffset = current_sample*11.0 * UvOffset; 
#line 149
Image.rgb += (
tex2Dlod( TiltShiftSampler, float4(float2(UvCoord.x, UvCoord.y+SampleOffset), 0.0, 0.0) ).rgb
+tex2Dlod( TiltShiftSampler, float4(float2(UvCoord.x, UvCoord.y-SampleOffset), 0.0, 0.0) ).rgb
) *current_weight;
}
#line 155
Image.rgb /= total_weight*2.0;
}
#line 159
Image.rgb = (Line && Image.a < 0.01) ? float3(1.0, 0.0, 0.0) : Image.rgb;
}
#line 167
technique TiltShift < ui_label = "Tilt Shift"; >
{
pass AlphaAndHorizontalGaussianBlur
{
VertexShader = PostProcessVS;
PixelShader = TiltShiftPass1PS;
RenderTarget = TiltShiftTarget;
}
pass VerticalGaussianBlurAndRedLine
{
VertexShader = PostProcessVS;
PixelShader = TiltShiftPass2PS;
}
}

