Example #1
0
        private void PerformBlur(ref RenderTexture src, ref RenderTexture dest, int iteration)
        {
            float offset = BlurOffset + iteration * BlurSpread;

            if (GlowCurve == GlowBlurCurve.Gauss)
            {
                offset *= gaussFilter[iteration];
            }

            if (GlowQuality == MKGlowQuality.Low)
            {
                FastBlurMaterial.SetTexture("_MainTex", src);
                FastBlurMaterial.SetFloat("_Shift", offset);
                Graphics.Blit(src, dest, FastBlurMaterial);
            }
            else
            {
                Graphics.BlitMultiTap(src, dest, BlurMaterial,
                                      new Vector2(offset, offset),
                                      new Vector2(-offset, offset),
                                      new Vector2(offset, -offset),
                                      new Vector2(-offset, -offset)
                                      );
            }
        }
Example #2
0
 private void PerformBlur(ref RenderTexture src, ref RenderTexture dest)
 {
     if (GlowQuality == MKGlowQuality.Low)
     {
         float off = (BlurOffset + BlurSpread);
         FastBlurMaterial.SetTexture("_MainTex", src);
         FastBlurMaterial.SetFloat("_Shift", off);
         Graphics.Blit(src, dest, FastBlurMaterial);
     }
     else
     {
         int offset = 1;
         Graphics.BlitMultiTap(src, dest, BlurMaterial,
                               new Vector2(offset, offset),
                               new Vector2(-offset, offset),
                               new Vector2(offset, -offset),
                               new Vector2(-offset, -offset)
                               );
     }
 }