Пример #1
0
 //--------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="GradientTextureSkyNode" /> class.
 /// </summary>
 public GradientTextureSkyNode()
 {
     SunDirection = new Vector3F(1, 1, 1);
       TimeOfDay = new TimeSpan(12, 0, 0);
       Color = new Vector4F(1, 1, 1, 1);
       CieSkyParameters = CieSkyParameters.Type12;
 }
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="GradientTextureSkyNode" /> class.
        /// </summary>
        public GradientTextureSkyNode()
        {
            SunDirection     = new Vector3F(1, 1, 1);
            TimeOfDay        = new TimeSpan(12, 0, 0);
            Color            = new Vector4F(1, 1, 1, 1);
            CieSkyParameters = CieSkyParameters.Type12;
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GradientSkyNode" /> class.
        /// </summary>
        public GradientSkyNode()
        {
            SunDirection     = new Vector3(1, 1, 1);
            FrontColor       = new Vector4(0.9f, 0.5f, 0, 1);
            ZenithColor      = new Vector4(0, 0.4f, 0.9f, 1);
            BackColor        = new Vector4(0.4f, 0.6f, 0.9f, 1);
            GroundColor      = new Vector4(1, 0.8f, 0.6f, 1);
            FrontZenithShift = 0.5f;
            BackZenithShift  = 0.5f;
            FrontGroundShift = 0.5f;
            BackGroundShift  = 0.5f;

            CieSkyParameters = CieSkyParameters.Type12;
        }
Пример #4
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="GradientSkyNode" /> class.
        /// </summary>
        public GradientSkyNode()
        {
            SunDirection = new Vector3F(1, 1, 1);
              FrontColor = new Vector4F(0.9f, 0.5f, 0, 1);
              ZenithColor = new Vector4F(0, 0.4f, 0.9f, 1);
              BackColor = new Vector4F(0.4f, 0.6f, 0.9f, 1);
              GroundColor = new Vector4F(1, 0.8f, 0.6f, 1);
              FrontZenithShift = 0.5f;
              BackZenithShift = 0.5f;
              FrontGroundShift = 0.5f;
              BackGroundShift = 0.5f;

              CieSkyParameters = CieSkyParameters.Type12;
        }
        /// <inheritdoc/>
        protected override void CloneCore(SceneNode source)
        {
            // Clone SkyNode properties.
            base.CloneCore(source);

            // Clone GradientTextureSkyNode properties.
            var sourceTyped = (GradientTextureSkyNode)source;

            SunDirection     = sourceTyped.SunDirection;
            TimeOfDay        = sourceTyped.TimeOfDay;
            FrontTexture     = sourceTyped.FrontTexture;
            BackTexture      = sourceTyped.BackTexture;
            Color            = sourceTyped.Color;
            CieSkyParameters = sourceTyped.CieSkyParameters;
            CieSkyStrength   = sourceTyped.CieSkyStrength;
        }
Пример #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CieSkyFilter"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public CieSkyFilter(IGraphicsService graphicsService) : base(graphicsService)
        {
            _effect = GraphicsService.Content.Load <Effect>("DigitalRune/PostProcessing/CieSkyFilter");
            _parameterViewportSize   = _effect.Parameters["ViewportSize"];
            _parameterFrustumCorners = _effect.Parameters["FrustumCorners"];
            _parameterSunDirection   = _effect.Parameters["SunDirection"];
            _parameterExposure       = _effect.Parameters["Exposure"];
            _parameterAbcd           = _effect.Parameters["Abcd"];
            _parameterEAndStrength   = _effect.Parameters["EAndStrength"];
            _parameterSourceTexture  = _effect.Parameters["SourceTexture"];

            Parameters   = CieSkyParameters.Type12;
            SunDirection = new Vector3(0, 1, 0);
            Exposure     = 1;
            Strength     = 1;
        }
Пример #7
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="CieSkyFilter"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public CieSkyFilter(IGraphicsService graphicsService)
            : base(graphicsService)
        {
            _effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/CieSkyFilter");
              _parameterViewportSize = _effect.Parameters["ViewportSize"];
              _parameterFrustumCorners = _effect.Parameters["FrustumCorners"];
              _parameterSunDirection = _effect.Parameters["SunDirection"];
              _parameterExposure = _effect.Parameters["Exposure"];
              _parameterAbcd = _effect.Parameters["Abcd"];
              _parameterEAndStrength = _effect.Parameters["EAndStrength"];
              _parameterSourceTexture = _effect.Parameters["SourceTexture"];

              Parameters = CieSkyParameters.Type12;
              SunDirection = new Vector3F(0, 1, 0);
              Exposure = 1;
              Strength = 1;
        }
Пример #8
0
        /// <inheritdoc/>
        protected override void CloneCore(SceneNode source)
        {
            // Clone SkyNode properties.
            base.CloneCore(source);

            // Clone GradientSkyNode properties.
            var sourceTyped = (GradientSkyNode)source;

            SunDirection     = sourceTyped.SunDirection;
            FrontColor       = sourceTyped.FrontColor;
            BackColor        = sourceTyped.BackColor;
            ZenithColor      = sourceTyped.ZenithColor;
            GroundColor      = sourceTyped.GroundColor;
            FrontZenithShift = sourceTyped.FrontZenithShift;
            BackZenithShift  = sourceTyped.BackZenithShift;
            FrontGroundShift = sourceTyped.FrontGroundShift;
            BackGroundShift  = sourceTyped.BackGroundShift;
            CieSkyParameters = sourceTyped.CieSkyParameters;
            CieSkyStrength   = sourceTyped.CieSkyStrength;
        }
Пример #9
0
        /// <inheritdoc/>
        protected override void CloneCore(SceneNode source)
        {
            // Clone SkyNode properties.
              base.CloneCore(source);

              // Clone GradientSkyNode properties.
              var sourceTyped = (GradientSkyNode)source;
              SunDirection = sourceTyped.SunDirection;
              FrontColor = sourceTyped.FrontColor;
              BackColor = sourceTyped.BackColor;
              ZenithColor = sourceTyped.ZenithColor;
              GroundColor = sourceTyped.GroundColor;
              FrontZenithShift = sourceTyped.FrontZenithShift;
              BackZenithShift = sourceTyped.BackZenithShift;
              FrontGroundShift = sourceTyped.FrontGroundShift;
              BackGroundShift = sourceTyped.BackGroundShift;
              CieSkyParameters = sourceTyped.CieSkyParameters;
              CieSkyStrength = sourceTyped.CieSkyStrength;
        }
Пример #10
0
        /// <inheritdoc/>
        protected override void CloneCore(SceneNode source)
        {
            // Clone SkyNode properties.
              base.CloneCore(source);

              // Clone GradientTextureSkyNode properties.
              var sourceTyped = (GradientTextureSkyNode)source;
              SunDirection = sourceTyped.SunDirection;
              TimeOfDay = sourceTyped.TimeOfDay;
              FrontTexture = sourceTyped.FrontTexture;
              BackTexture = sourceTyped.BackTexture;
              Color = sourceTyped.Color;
              CieSkyParameters = sourceTyped.CieSkyParameters;
              CieSkyStrength = sourceTyped.CieSkyStrength;
        }