BlurEffect.cs - UF-CSSALT/SMARTS-SDK-Unity-Asset-Package GitHub Wiki
The Blur Effect script creates the blur effect for the ultrasound renderings.
Public Fields
int iterations
This is the number of blur iterations that will occur. A larger number will create more blur.
float blurSpread
This creates the blue spread for each iteration. Lower values will produce a better looking blur but require more iterations to create large blurs. The value of blurSpread is usually between 0.5 and 1.0.
Shader blurShader
This is a blur iteration shader that takes four texture samples and averages them. By repeatedly performing this procedure and spreading out the sample locations an approximate Gaussian blur is performed.
Public Methods
void FourTapCone (RenderTexture source, RenderTexture dest, int iteration)
This method performs one blur iteration.
Private Methods
void DownSample4x (RenderTexture source, RenderTexture dest)
Downsamples the texture to a quarter resolution.
OnRenderImage (RenderTexture source, RenderTexture destination)
This method is called by the camera to apply the image effect.