Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2018
13,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. const float2 ScreenMult = View.ViewSizeAndInvSize.xy * View.BufferSizeAndInvSize.zw;
  2.  
  3. const int TexIndex = 14;
  4. const float Samples[11] = {-0.08,-0.05,-0.03,-0.02,-0.01,0,0.01,0.02,0.03,0.05,0.08};
  5.  
  6. float2 dir = float2(0.5,0.5) - ScreenUV;
  7. float4 sum = float4(0.0, 0.0, 0.0, 0.0);
  8. for(int i = 0; i<11; i++)
  9. {
  10. float2 pos = ScreenUV + dir * Samples[i] * BlurDist;
  11. pos = clamp(pos, float2(0.0,0.0), float2(1.0, 1.0));
  12. sum += SceneTextureLookup(pos * ScreenMult, TexIndex, false);
  13. }
  14.  
  15. return sum / 11.0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement