Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SepiaMaterial"/> class.
        /// </summary>
        public SepiaMaterial()
            : base(DefaultLayers.Opaque)
        {
            this.ImageTone    = new Vector3(0.815f, 0.666f, 0f);
            this.Desaturation = 1.0f;
            this.DarkTone     = new Vector3(0.313f, 0.258f, 0f);
            this.Toning       = 0.35f;
            this.GreyTransfer = new Vector3(0.3f, 0.59f, 0.11f);
            this.GlobalAlpha  = 1.0f;

            this.shaderParameters              = new SepiaEffectParameters();
            this.shaderParameters.ImageTone    = this.ImageTone;
            this.shaderParameters.Desaturation = this.Desaturation;
            this.shaderParameters.DarkTone     = this.DarkTone;
            this.shaderParameters.Toning       = this.Toning;
            this.shaderParameters.GreyTransfer = this.GreyTransfer;
            this.shaderParameters.GlobalAlpha  = this.GlobalAlpha;
            this.Parameters = this.shaderParameters;

            this.InitializeTechniques(techniques);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SepiaMaterial"/> class.
        /// </summary>
        public SepiaMaterial()
            : base(DefaultLayers.Opaque)
        {
            this.SamplerMode = AddressMode.LinearClamp;
            this.ImageTone = new Vector3(0.815f, 0.666f, 0f);
            this.Desaturation = 1.0f;
            this.DarkTone = new Vector3(0.313f, 0.258f, 0f);
            this.Toning = 0.35f;
            this.GreyTransfer = new Vector3(0.3f, 0.59f, 0.11f);
            this.GlobalAlpha = 1.0f;

            this.shaderParameters = new SepiaEffectParameters();
            this.shaderParameters.ImageTone = this.ImageTone;
            this.shaderParameters.Desaturation = this.Desaturation;
            this.shaderParameters.DarkTone = this.DarkTone;
            this.shaderParameters.Toning = this.Toning;
            this.shaderParameters.GreyTransfer = this.GreyTransfer;
            this.shaderParameters.GlobalAlpha = this.GlobalAlpha;
            this.Parameters = this.shaderParameters;

            this.InitializeTechniques(techniques);
        }