#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\Levels.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 21 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\Levels.fx"
#line 23
uniform int BlackPoint <        ui_type = "slider"; 
ui_min = 0; ui_max = 255;
ui_label = "Black Point";
ui_tooltip = "The black point is the new black - literally. Everything darker than this will become completely black.";
> = 16;
#line 29
uniform int WhitePoint <        ui_type = "slider"; 
ui_min = 0; ui_max = 255;
ui_label = "White Point";
ui_tooltip = "The new white point. Everything brighter than this becomes completely white";
> = 235;
#line 35
uniform bool HighlightClipping <
ui_label = "Highlight clipping pixels";
ui_tooltip = "Colors between the two points will stretched, which increases contrast, but details above and below the points are lost (this is called clipping).\n"
"This setting marks the pixels that clip.\n"
"Red: Some detail is lost in the highlights\n"
"Yellow: All detail is lost in the highlights\n"
"Blue: Some detail is lost in the shadows\n"
"Cyan: All detail is lost in the shadows.";
> = 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 = 2520 * (1.0 / 1500);
static const float2 PixelSize = float2((1.0 / 2520), (1.0 / 1500));
static const float2 ScreenSize = float2(2520, 1500);
#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 45 "D:\The.Elder.Scrolls.V.Skyrim.VR.v1.4.0.15.8\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\Levels.fx"
#line 47
float3 LevelsPass(float4 vpos : SV_Position, float2 texcoord : TexCoord) : SV_Target
{
float black_point_float = BlackPoint / 255.0;
float white_point_float = WhitePoint == BlackPoint ? (255.0 / 0.00025) : (255.0 / (WhitePoint - BlackPoint)); 
#line 52
float3 color = tex2D(ReShade::BackBuffer, texcoord).rgb;
color = color * white_point_float - (black_point_float *  white_point_float);
#line 55
if (HighlightClipping)
{
float3 clipped_colors;
#line 59
clipped_colors = any(color > saturate(color)) 
? float3(1.0, 0.0, 0.0)
: color;
clipped_colors = all(color > saturate(color)) 
? float3(1.0, 1.0, 0.0)
: clipped_colors;
clipped_colors = any(color < saturate(color)) 
? float3(0.0, 0.0, 1.0)
: clipped_colors;
clipped_colors = all(color < saturate(color)) 
? float3(0.0, 1.0, 1.0)
: clipped_colors;
#line 72
color = clipped_colors;
}
#line 75
return color;
}
#line 78
technique Levels
{
pass
{
VertexShader = PostProcessVS;
PixelShader = LevelsPass;
}
}

