/// <summary>
        ///
        /// </summary>
        private void SetLightParameters()
        {
            Vector3 sunDir = this.SkyX.AtmosphereManager.SunDirection;

            if (sunDir.y > 0.1f)
            {
                sunDir = -sunDir;
            }

            this.VClouds.SunDirection = sunDir;

            float point = (-this.SkyX.AtmosphereManager.SunDirection.y + 1.0f) / 2.0f;

            this.VClouds.AmbientColor = _ambientGradient.GetColor(point);
            this.VClouds.SunColor     = _sunGradient.GetColor(point);
        }
Beispiel #2
0
        /// <summary>
        /// Update internal cloud pass parameters
        /// </summary>
        public void UpdateInternalPassParameters()
        {
            if (_cloudLayerPass == null)
            {
                return;
            }

            if (this.SkyX.LightingMode == LightingMode.Ldr)
            {
                _cloudLayerPass.GetFragmentProgramParameters().SetNamedConstant("uExposure", this.SkyX.AtmosphereManager.Options.Exposure);
            }

            _cloudLayerPass.GetFragmentProgramParameters().SetNamedConstant("uTime", this.SkyX.TimeOffset * _options.TimeMultiplier);

            Vector3 sunDir = this.SkyX.AtmosphereManager.SunDirection;

            if (sunDir.y > 0.15f)
            {
                sunDir = -sunDir;
            }

            _cloudLayerPass.GetFragmentProgramParameters().SetNamedConstant("uSunPosition", -sunDir * this.SkyX.MeshManager.SkydomeRadius);

            float point = (-this.SkyX.AtmosphereManager.SunDirection.y + 1.0f) / 2.0f;

            _cloudLayerPass.GetFragmentProgramParameters().SetNamedConstant("uSunColor", _sunGradiant.GetColor(point));
            _cloudLayerPass.GetFragmentProgramParameters().SetNamedConstant("uAmbientLuminosity", _ambientGradiant.GetColor(point));
        }