Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float Luminance = 0.08f;
- static const float fMiddleGray = 0.18f;
- static const float fWhiteCutoff = 0.8f;
- //-----------------------------------------------------------------------------
- // Pixel Shader: BrightPassFilter
- // Desc: Perform a high-pass filter on the source texture
- //-----------------------------------------------------------------------------
- float4 BrightPassFilter( in float2 Tex : TEXCOORD0 ) : COLOR0
- {
- float3 ColorOut = tex2D( g_samSrcColor, Tex );
- ColorOut *= fMiddleGray / ( Luminance + 0.001f );
- ColorOut *= ( 1.0f + ( ColorOut / ( fWhiteCutoff * fWhiteCutoff ) ) );
- ColorOut -= 5.0f;
- ColorOut = max( ColorOut, 0.0f );
- ColorOut /= ( 10.0f + ColorOut );
- return float4( ColorOut, 1.0f );
- }
Add Comment
Please, Sign In to add comment