コード例 #1
0
 public void Apply(int pass)
 {
     shaderParams.Set(brightThresholdKey, BrightThreshold);
     shaderParams.Set(darkThresholdKey, DarkThreshold);
     shaderParams.Set(softLightKey, SoftLight);
     PlatformRenderer.SetBlendState(!Opaque ? Blending.Alpha.GetBlendState() : disabledBlendingState);
     PlatformRenderer.SetShaderProgram(NoiseShaderProgram.GetInstance(Opaque));
     PlatformRenderer.SetShaderParams(shaderParamsArray);
 }
コード例 #2
0
        public static NoiseShaderProgram GetInstance(bool opaque = false)
        {
            var key = GetInstanceKey(false);

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