#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\LumaSharpen.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 13 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\LumaSharpen.fx"
#line 15
uniform float sharp_strength <      ui_type = "slider"; 
ui_min = 0.1; ui_max = 3.0;
ui_label = "Shapening strength";
ui_tooltip = "Strength of the sharpening";
#line 20
> = 0.65;
uniform float sharp_clamp <      ui_type = "slider"; 
ui_min = 0.0; ui_max = 1.0; ui_step = 0.005;
ui_label = "Sharpening limit";
ui_tooltip = "Limits maximum amount of sharpening a pixel receives\nThis helps avoid \"haloing\" artifacts which would otherwise occur when you raised the strength too much.";
> = 0.035;
uniform int pattern <
ui_type = "combo";
ui_items =	"Fast" "\0"
"Normal" "\0"
"Wider"	"\0"
"Pyramid shaped" "\0";
ui_label = "Sample pattern";
ui_tooltip = "Choose a sample pattern.\n"
"Fast is faster but slightly lower quality.\n"
"Normal is normal.\n"
"Wider is less sensitive to noise but also to fine details.\n"
"Pyramid has a slightly more aggresive look.";
> = 1;
uniform float offset_bias <      ui_type = "slider"; 
ui_min = 0.0; ui_max = 6.0;
ui_label = "Offset bias";
ui_tooltip = "Offset bias adjusts the radius of the sampling pattern. I designed the pattern for an offset bias of 1.0, but feel free to experiment.";
> = 1.0;
uniform bool show_sharpen <
ui_label = "Show sharpening pattern";
ui_tooltip = "Visualize the strength of the sharpen\nThis is useful for seeing what areas the sharpning affects the most";
> = false;
#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 = 3280 * (1.0 / 1957);
static const float2 PixelSize = float2((1.0 / 3280), (1.0 / 1957));
static const float2 ScreenSize = float2(3280, 1957);
#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 49 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\LumaSharpen.fx"
#line 62
float3 LumaSharpenPass(float4 position : SV_Position, float2 tex : TEXCOORD) : SV_Target
{
#line 65
float3 ori = tex2D(ReShade::BackBuffer, tex).rgb; 
#line 68
float3 sharp_strength_luma = ( float3(0.2126, 0.7152, 0.0722)       * sharp_strength); 
#line 73
float3 blur_ori;
#line 80
if (pattern == 0)
{
#line 87
blur_ori  = tex2D(ReShade::BackBuffer, tex + ( float2((1.0 / 3280), (1.0 / 1957)) / 3.0) * offset_bias).rgb;  
blur_ori += tex2D(ReShade::BackBuffer, tex + (- float2((1.0 / 3280), (1.0 / 1957)) / 3.0) * offset_bias).rgb; 
#line 93
blur_ori /= 2;  
#line 95
sharp_strength_luma *= 1.5; 
}
#line 99
if (pattern == 1)
{
#line 106
blur_ori  = tex2D(ReShade::BackBuffer, tex + float2( float2((1.0 / 3280), (1.0 / 1957)).x, - float2((1.0 / 3280), (1.0 / 1957)).y) * 0.5 * offset_bias).rgb; 
blur_ori += tex2D(ReShade::BackBuffer, tex -  float2((1.0 / 3280), (1.0 / 1957)) * 0.5 * offset_bias).rgb;  
blur_ori += tex2D(ReShade::BackBuffer, tex +  float2((1.0 / 3280), (1.0 / 1957)) * 0.5 * offset_bias).rgb; 
blur_ori += tex2D(ReShade::BackBuffer, tex - float2( float2((1.0 / 3280), (1.0 / 1957)).x, - float2((1.0 / 3280), (1.0 / 1957)).y) * 0.5 * offset_bias).rgb; 
#line 111
blur_ori *= 0.25;  
}
#line 115
if (pattern == 2)
{
#line 124
blur_ori  = tex2D(ReShade::BackBuffer, tex +  float2((1.0 / 3280), (1.0 / 1957)) * float2(0.4, -1.2) * offset_bias).rgb;  
blur_ori += tex2D(ReShade::BackBuffer, tex -  float2((1.0 / 3280), (1.0 / 1957)) * float2(1.2, 0.4) * offset_bias).rgb; 
blur_ori += tex2D(ReShade::BackBuffer, tex +  float2((1.0 / 3280), (1.0 / 1957)) * float2(1.2, 0.4) * offset_bias).rgb; 
blur_ori += tex2D(ReShade::BackBuffer, tex -  float2((1.0 / 3280), (1.0 / 1957)) * float2(0.4, -1.2) * offset_bias).rgb; 
#line 129
blur_ori *= 0.25;  
#line 131
sharp_strength_luma *= 0.51;
}
#line 135
if (pattern == 3)
{
#line 142
blur_ori  = tex2D(ReShade::BackBuffer, tex + float2(0.5 *  float2((1.0 / 3280), (1.0 / 1957)).x, - float2((1.0 / 3280), (1.0 / 1957)).y * offset_bias)).rgb;  
blur_ori += tex2D(ReShade::BackBuffer, tex + float2(offset_bias * - float2((1.0 / 3280), (1.0 / 1957)).x, 0.5 * - float2((1.0 / 3280), (1.0 / 1957)).y)).rgb; 
blur_ori += tex2D(ReShade::BackBuffer, tex + float2(offset_bias *  float2((1.0 / 3280), (1.0 / 1957)).x, 0.5 *  float2((1.0 / 3280), (1.0 / 1957)).y)).rgb; 
blur_ori += tex2D(ReShade::BackBuffer, tex + float2(0.5 * - float2((1.0 / 3280), (1.0 / 1957)).x,  float2((1.0 / 3280), (1.0 / 1957)).y * offset_bias)).rgb; 
#line 149
blur_ori /= 4.0;  
#line 151
sharp_strength_luma *= 0.666; 
}
#line 159
float3 sharp = ori - blur_ori;  
#line 170
float4 sharp_strength_luma_clamp = float4(sharp_strength_luma * (0.5 / sharp_clamp),0.5); 
#line 173
float sharp_luma = saturate(dot(float4(sharp,1.0), sharp_strength_luma_clamp)); 
sharp_luma = (sharp_clamp * 2.0) * sharp_luma - sharp_clamp; 
#line 178
float3 outputcolor = ori + sharp_luma;    
#line 184
if (show_sharpen)
{
#line 187
outputcolor = saturate(0.5 + (sharp_luma * 4.0)).rrr;
}
#line 190
return saturate(outputcolor);
}
#line 193
technique LumaSharpen
{
pass
{
VertexShader = PostProcessVS;
PixelShader = LumaSharpenPass;
}
}

