Example #1
0
 public void Apply(int pass)
 {
     shaderParams.Set(stepKey, Dir * Radius * Step);
     shaderParams.Set(alphaCorrectionKey, 1f / AlphaCorrection);
     PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(BlurShaderProgram.GetInstance(BlurShaderId, Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
Example #2
0
        public static BlurShaderProgram GetInstance(BlurShaderId blurShaderId = BlurShaderId.GaussOneDimensionalWith5Samples, bool opaque = false)
        {
            var key = GetInstanceKey(blurShaderId, false);

            return(instances.TryGetValue(key, out var shaderProgram) ? shaderProgram : (instances[key] = new BlurShaderProgram(blurShaderId, opaque)));
        }