Ember

Untitled

Jul 8th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. // For each sample, sum up each sample's color in "Blurred" and then divide
  2. // to average the color after all the samples are added.
  3. float3 Blurred = 0;
  4. for(float i = 0; i < NumberOfPostProcessSamples; i++)
  5. {
  6. // Sample texture in a new spot based on pixelVelocity vector
  7. // and average it with the other samples
  8. float2 lookup = pixelVelocity * i / NumberOfPostProcessSamples + OriginalUV;
  9.  
  10. // Lookup the color at this new spot
  11. float4 Current = tex2D(RenderTargetSampler, lookup);
  12.  
  13. // Add it with the other samples
  14. Blurred += Current.rgb;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment