// LFS Pixel Shader : PostProcess // Vertex shader output struct VS_OUTPUT { float4 Position : POSITION; float4 Color : COLOR0; float2 Texture : TEXCOORD0; }; // Global variables sampler2D Tex0; // Main function float4 ps_main( in VS_OUTPUT In ) : COLOR { // look up colour float4 tex_col = tex2D(Tex0, In.Texture); // NO CHANGE // return tex_col; // S-SHAPE float4 x_sq = tex_col * tex_col; float4 x_cu = x_sq * tex_col; // return -2.0f * x_cu + 3.0f * x_sq; // GAMMA // return pow(tex_col, 0.5f); // CONTRAST return (tex_col - float4(0.5f, 0.5f, 0.5f, 0.0f)) * 1.0f + float4(0.5f, 0.5f, 0.5f, 0.0f); // contrast // SIMPLE HDR // return tex_col / (1.0f + tex_col); }