#line 1 "unknown"

#line 1 "C:\GOG Games\Kenshi\reshade-shaders\Shaders\NightVision.fx"
#line 1 "C:\GOG Games\Kenshi\reshade-shaders\Shaders\ReShade.fxh"
#line 50
namespace ReShade
{
#line 61
static const float AspectRatio = 1366 * (1.0 / 768);
static const float2 PixelSize = float2((1.0 / 1366), (1.0 / 768));
static const float2 ScreenSize = float2(1366, 768);
#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 1 "C:\GOG Games\Kenshi\reshade-shaders\Shaders\NightVision.fx"
#line 3
uniform float iGlobalTime < source = "timer"; >;
#line 5
float hash(in float n) { return frac(sin(n)*43758.5453123); }
#line 7
float mod(float x, float y)
{
return x - y * floor (x/y);
}
#line 12
float3 PS_Nightvision(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_Target
{
float2 p = uv;
#line 16
float2 u = p * 2. - 1.;
float2 n = u * float2( (1366 * (1.0 / 768)), 1.0);
float3 c = tex2D(ReShade::BackBuffer, uv).xyz;
#line 21
c += sin(hash(iGlobalTime*0.001)) * 0.01;
c += hash((hash(n.x) + n.y) * iGlobalTime*0.001) * 0.5;
c *= smoothstep(length(n * n * n * float2(0.0, 0.0)), 1.0, 0.4);
c *= smoothstep(0.001, 3.5, iGlobalTime*0.001) * 1.5;
#line 26
c = dot(c, float3(0.2126, 0.7152, 0.0722))
* float3(0.2, 1.5 - hash(iGlobalTime*0.001) * 0.1,0.4);
#line 29
return c;
}
#line 32
technique Nightvision {
pass Nightvision {
VertexShader=PostProcessVS;
PixelShader=PS_Nightvision;
}
}

