//
struct VS_IN
{
    float4 position : POSITION;
    float2 tex_coord : TEXCOORD0;
};

struct VS_OUT
{
    float4 position : SV_Position;
    float2 tex_coord : TEXCOORD0;
};

VS_OUT vs_main(VS_IN IN)
{
    VS_OUT OUT;
    OUT.position = IN.position;
    OUT.tex_coord = IN.tex_coord;
    return OUT;
};

float3 glare_params;
Texture2D<float4> scene_texture : register(t0);
sampler tex_sampler;

float4 ps_main(VS_OUT IN) : SV_Target
{
    float4 color = scene_texture.Sample(tex_sampler, IN.tex_coord);
    float3 final_glare = color - glare_params;
    final_glare = clamp(final_glare, 0, 10000);
    return float4(final_glare, color.w);
};

