Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Effect"/> class.
        /// </summary>
        /// <param name="impl">The <see cref="EffectImplementation"/> that implements this effect.</param>
        protected Effect(EffectImplementation impl)
            : base(impl.Ultraviolet)
        {
            Contract.Require(impl, nameof(impl));

            this.impl = impl;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SkinnedEffect"/> class.
 /// </summary>
 /// <param name="impl">The <see cref="EffectImplementation"/> that implements this effect.</param>
 protected SkinnedEffect(EffectImplementation impl)
     : base(impl)
 {
     DirectionalLight0 = CreateDirectionalLight(0);
     DirectionalLight1 = CreateDirectionalLight(1);
     DirectionalLight2 = CreateDirectionalLight(2);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlurEffect"/> class.
        /// </summary>
        /// <param name="impl">The <see cref="EffectImplementation"/> that implements this effect.</param>
        protected BlurEffect(EffectImplementation impl)
            : base(impl)
        {
            this.epTexture     = Parameters["Texture"];
            this.epTextureSize = Parameters["TextureSize"];
            this.epWorld       = Parameters["World"];
            this.epView        = Parameters["View"];
            this.epProjection  = Parameters["Projection"];
            this.epMix         = Parameters["Mix"];

            this.Radius = 5f;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BasicEffect"/> class.
        /// </summary>
        /// <param name="impl">The <see cref="EffectImplementation"/> that implements this effect.</param>
        protected BasicEffect(EffectImplementation impl)
            : base(impl)
        {
            this.epDiffuseColor = Parameters["DiffuseColor"];
            this.epWorld        = Parameters["World"];
            this.epView         = Parameters["View"];
            this.epProjection   = Parameters["Projection"];
            this.epSrgbColor    = Parameters["SrgbColor"];
            this.epTexture      = Parameters["Texture"];

            this.epDiffuseColor.SetValue(Color.White);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a new instance of the <see cref="Effect"/> class.
        /// </summary>
        /// <param name="impl">The effect implementation that the effect encapsulates.</param>
        /// <returns>The instance of <see cref="Effect"/> that was created.</returns>
        public static Effect Create(EffectImplementation impl)
        {
            Contract.Require(impl, nameof(impl));

            return(new Effect(impl));
        }