public void Apply(int pass) { shaderParams.Set(texelStepKey, TexelStep); shaderParams.Set(amountKey, new Vector4(LumaTreshold, 0.25f / MulReduce, 1f / MinReduce, MaxSpan)); PlatformRenderer.SetBlendState(!Opaque ? Blending.GetBlendState() : disabledBlendingState); PlatformRenderer.SetShaderProgram(FXAAShaderProgram.GetInstance(Opaque)); PlatformRenderer.SetShaderParams(shaderParamsArray); }
public static FXAAShaderProgram GetInstance(bool opaque = false) { var key = GetInstanceKey(false); return(instances.TryGetValue(key, out var shaderProgram) ? shaderProgram : (instances[key] = new FXAAShaderProgram(opaque))); }