void OnRenderImage(RenderTexture source, RenderTexture destination)
 {
     if (_settings.shutterAngle > 0 && _settings.frameBlending > 0)
     {
         // Reconstruction and frame blending
         var temp = RenderTexture.GetTemporary(source.width, source.height, 0, source.format);
         _reconstructionFilter.ProcessImage(_settings.shutterAngle, _settings.sampleCount, source, temp);
         _frameBlendingFilter.BlendFrames(_settings.frameBlending, temp, destination);
         _frameBlendingFilter.PushFrame(temp);
         RenderTexture.ReleaseTemporary(temp);
     }
     else if (_settings.shutterAngle > 0)
     {
         // Reconstruction only
         _reconstructionFilter.ProcessImage(_settings.shutterAngle, _settings.sampleCount, source, destination);
     }
     else if (_settings.frameBlending > 0)
     {
         // Frame blending only
         _frameBlendingFilter.BlendFrames(_settings.frameBlending, source, destination);
         _frameBlendingFilter.PushFrame(source);
     }
     else
     {
         // Nothing to do!
         Graphics.Blit(source, destination);
     }
 }
Exemple #2
0
        private RenderTexture MotionBlurPass(RenderTexture src, RenderTexture dest)
        {
            if (!Application.isPlaying) //GM.options.mblur <= 0 ||
            {
                return(src);
            }

            if (m_reconstructionFilter == null)
            {
                m_reconstructionFilter = new ReconstructionFilter();
            }

            m_reconstructionFilter.ProcessImage(360, 8, src, dest); //GM.options.mblur

            return(dest);
        }