Guest User

Untitled

a guest
Apr 4th, 2018
139
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ReShade.fxh"
  2.  
  3. uniform float3 f3ShutterSpeed <
  4.     ui_label = "Shutter Speed";
  5.     ui_type = "drag";
  6.     ui_min = 0.1;
  7.     ui_max = 100.0;
  8.     ui_step = 0.1;
  9. > = float3(1.0, 1.0, 1.0);
  10.  
  11. uniform fFrameTime <source = "frametime";>;
  12.  
  13. sampler2D sBackBuffer {
  14.     Texture = ReShade::BackBufferTex;
  15.     SRGBTexture = true;
  16.     MinFilter = POINT;
  17.     MagFilter = POINT;
  18.     MipFilter = POINT;
  19. };
  20.  
  21. texture2D tChromaticMotion_Last {
  22.     Width = BUFFER_WIDTH;
  23.     Height = BUFFER_HEIGHT;
  24. };
  25. sampler2D sLast {
  26.     Texture = tChromaticMotion_Last;
  27.     MinFilter = POINT;
  28.     MagFilter = POINT;
  29.     MipFilter = POINT;
  30. };
  31.  
  32. float4 PS_Blend(
  33.     float4 position : SV_POSITION,
  34.     float2 uv       : TEXCOORD
  35. ) : SV_TARGET {
  36.     float3 curr = tex2D(sBackBuffer, uv).rgb;
  37.     float3 last = tex2D(sLast, uv).rgb;
  38.  
  39.     float d = fFrameTime * 0.001;
  40.     curr = lerp(last, curr, d / f3ShutterSpeed);
  41.    
  42.     return float4(curr, 1.0);
  43. }
  44.  
  45. float4 PS_Save(
  46.     float4 position : SV_POSITION,
  47.     float2 uv       : TEXCOORD
  48. ) : SV_TARGET {
  49.     return tex2D(sBackBuffer, uv);
  50. }
  51.  
  52. technique ChromaticMotion {
  53.     pass Blend {
  54.         VertexShader = PostProcessVS;
  55.         PixelShader = PS_Blend;
  56.         SRGBWriteEnable = true;
  57.     }
  58.     pass Save {
  59.         VertexShader = PostProcessVS;
  60.         PixelShader = PS_Save;
  61.         RenderTarget = tChromaticMotion_Last;
  62.     }
  63. }
RAW Paste Data