Exemple #1
0
        /// <summary>
        /// Updates the color of <see cref="_lightMoon"/>.
        /// </summary>
        private void UpdateLightingColorMoon()
        {
            // Fast intensity fall-off near the horizon
            float elevationFactor = (-_lightMoon.Direction.Y * 4).Clamp();

            _lightMoon.Diffuse  = ColorUtils.Interpolate(elevationFactor, Color.Black, Universe.MoonColor);
            _lightMoon.Specular = Color4.Scale(_lightMoon.Diffuse, DiffuseToSpecularRatio).ToColor();
            _lightMoon.Ambient  = Color.Black;
            _lightMoon.Enabled  = (elevationFactor > 0); // Only on when above horizon
        }
Exemple #2
0
        /// <summary>
        /// Updates the color of <see cref="_lightSun"/>.
        /// </summary>
        private void UpdateLightingColorSun()
        {
            // Fast intensity fall-off near the horizon
            float elevationFactor = (-_lightSun.Direction.Y * 4).Clamp();

            _lightSun.Diffuse  = ColorUtils.Interpolate(elevationFactor, Color.Black, Universe.SunColor);
            _lightSun.Specular = Color4.Scale(_lightSun.Diffuse, DiffuseToSpecularRatio).ToColor();
            _lightSun.Ambient  = Universe.AmbientColor;
            _lightSun.Enabled  = true; // Always on (for ambient light)
        }
 /// <summary>
 /// Scales a color
 /// </summary>
 /// <param name="color">Color value</param>
 /// <param name="value">Scale factor</param>
 /// <returns></returns>
 public static Color Scale(Color color, float value)
 {
     return(new Color(Color4.Scale(color.RawColor, value)));
 }
Exemple #4
0
 private void FadeIn()
 {
     foreground.FadeColour(ForegroundColor.Scale(1.5f), 200, EasingTypes.Out);
 }