Guest User

Untitled

a guest
May 26th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment