#line 1 "unknown"

#line 1 "D:\Games\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\UIMask.fx"
#line 1 "D:\Games\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\ReShade.fxh"
#line 50
namespace ReShade
{
#line 61
static const float AspectRatio = 2658 * (1.0 / 1589);
static const float2 PixelSize = float2((1.0 / 2658), (1.0 / 1589));
static const float2 ScreenSize = float2(2658, 1589);
#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 101 "D:\Games\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\UIMask.fx"
#line 1 "D:\Games\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\ReShadeUI.fxh"
#line 102 "D:\Games\The Elder Scrolls V Skyrim VR\reshade-shaders\Shaders\UIMask.fx"
#line 128
namespace UIMask
{
#line 133
uniform int _Help
<
ui_label = " ";
ui_text =
"For more detailed instructions, see the text at the top of this "
"effect's shader file (UIMask.fx).\n"
"\n"
"Available preprocessor definitions:\n"
"  UIMASK_MULTICHANNEL:\n"
"    If set to 1, each of the RGB color channels in the texture is "
"treated as a separate mask.\n"
"  UIMASK_TOGGLEKEY_RED:\n"
"    Defines the key for using the mask in the red channel, the "
"default is Numpad 7.\n"
"  UIMASK_TOGGLEKEY_GREEN:\n"
"    Defines the key for using the mask in the green channel, the "
"default is Numpad 8.\n"
"  UIMASK_TOGGLEKEY_BLUE:\n"
"    Defines the key for using the mask in the blue channel, the "
"default is Numpad 9.\n"
"\n"
"Google \"virtual key codes\" for the values of each keyboard key.\n"
"\n"
"How to create a mask:\n"
"\n"
"1. Take a screenshot with the game's UI appearing.\n"
"2. Open the screenshot in an image editor, GIMP or Photoshop are "
"recommended.\n"
"3. Create a new layer over the screenshot layer, fill it with black.\n"
"4. Reduce the layer opacity so you can see the screenshot layer "
"below.\n"
"5. Cover the UI with white to mask it from effects. The stronger the "
"mask white color, the more opaque the mask will be.\n"
"6. Set the mask layer opacity back to 100%.\n"
"7. Save the image in one of your texture folders, named "
"\"UIMask.png\".\n"
;
ui_category = "Help";
ui_category_closed = true;
ui_type = "radio";
>;
#line 175
uniform float fMask_Intensity
<
     ui_type = "slider"; 
#line 179
ui_label = "Mask Intensity";
ui_tooltip =
"How much to mask effects from affecting the original image.\n"
"\nDefault: 1.0";
ui_min = 0.0;
ui_max = 1.0;
ui_step = 0.001;
> = 1.0;
#line 188
uniform bool bDisplayMask <
ui_label = "Display Mask";
ui_tooltip =
"Display the mask texture.\n"
"Useful for testing multiple channels or simply the mask itself.\n"
"\nDefault: Off";
> = false;
#line 225
texture BackupTex
{
Width = 2658;
Height = 1589;
};
sampler Backup
{
Texture = BackupTex;
};
#line 235
texture MaskTex <source="UIMask.png";>
{
Width = 2658;
Height = 1589;
Format =  R8;
};
sampler Mask
{
Texture = MaskTex;
};
#line 250
float4 BackupPS(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target {
return tex2D(ReShade::BackBuffer, uv);
}
#line 254
float4 MainPS(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target {
float4 color = tex2D(ReShade::BackBuffer, uv);
float4 backup = tex2D(Backup, uv);
#line 259
float mask = tex2D(Mask, uv).r;
#line 271
color = lerp(color, backup, mask * fMask_Intensity);
color = bDisplayMask ? mask : color;
#line 274
return color;
}
#line 281
technique UIMask_Top
<
ui_tooltip = "Place this *above* the effects to be masked.";
>
{
pass
{
VertexShader = PostProcessVS;
PixelShader = BackupPS;
RenderTarget = BackupTex;
}
}
#line 294
technique UIMask_Bottom
<
ui_tooltip =
"Place this *below* the effects to be masked.\n"
"If you want to add a toggle key for the effect, set it to this one.";
>
{
pass
{
VertexShader = PostProcessVS;
PixelShader = MainPS;
}
}
#line 310
} 

