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); }
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))); }