daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest May 26th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float Luminance = 0.08f;
  2. static const float fMiddleGray = 0.18f;
  3. static const float fWhiteCutoff = 0.8f;
  4.  
  5. //-----------------------------------------------------------------------------
  6. // Pixel Shader: BrightPassFilter
  7. // Desc: Perform a high-pass filter on the source texture
  8. //-----------------------------------------------------------------------------
  9. float4 BrightPassFilter( in float2 Tex : TEXCOORD0 ) : COLOR0
  10. {
  11.     float3 ColorOut = tex2D( g_samSrcColor, Tex );
  12.  
  13.     ColorOut *= fMiddleGray / ( Luminance + 0.001f );
  14.     ColorOut *= ( 1.0f + ( ColorOut / ( fWhiteCutoff * fWhiteCutoff ) ) );
  15.     ColorOut -= 5.0f;
  16.  
  17.     ColorOut = max( ColorOut, 0.0f );
  18.  
  19.     ColorOut /= ( 10.0f + ColorOut );
  20.  
  21.     return float4( ColorOut, 1.0f );
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top