コード例 #1
0
    private void WriteTexture(Texture2D texture2D, float u, int x, Color baseColor, SgtEase.Type ease, float colorPower, float alphaPower)
    {
        var colorU = SgtHelper.Pow(u, colorPower); colorU = SgtEase.Evaluate(ease, colorU);
        var alphaU = SgtHelper.Pow(u, alphaPower); alphaU = SgtEase.Evaluate(ease, alphaU);

        var color = Color.Lerp(baseColor, HorizonColor, colorU);

        color.a = alphaU;

        texture2D.SetPixel(x, 0, color);
    }
コード例 #2
0
 /// <summary>The transition style between the day and night.</summary>
 [FormerlySerializedAs("nightEase")] public SgtEase.Type NightEase; public void SetNightEase(SgtEase.Type value)
 {
     NightEase = value;
 }
コード例 #3
0
 /// <summary>The transition style between the day and night.</summary>
 [FormerlySerializedAs("sunsetEase")] public SgtEase.Type SunsetEase = SgtEase.Type.Smoothstep; public void SetSunsetEase(SgtEase.Type value)
 {
     SunsetEase = value; UpdateTexture();
 }
コード例 #4
0
        private void WritePixel(Texture2D texture2D, float u, int x, Color baseColor, SgtEase.Type ease, float colorSharpness, float alphaSharpness)
        {
            var colorU = SgtHelper.Sharpness(u, colorSharpness); colorU = SgtEase.Evaluate(ease, colorU);
            var alphaU = SgtHelper.Sharpness(u, alphaSharpness); alphaU = SgtEase.Evaluate(ease, alphaU);
            var color  = Color.Lerp(baseColor, HorizonColor, colorU);

            color.a = alphaU;

            texture2D.SetPixel(x, 0, color);
        }
コード例 #5
0
 /// <summary>The transition style between the sky and horizon.</summary>
 [FormerlySerializedAs("outerEase")] public SgtEase.Type OuterEase = SgtEase.Type.Quadratic; public void SetOuterEase(SgtEase.Type value)
 {
     OuterEase = value; UpdateTextures();
 }
コード例 #6
0
 /// <summary>The transition style between the surface and horizon.</summary>
 [FormerlySerializedAs("innerEase")] public SgtEase.Type InnerEase = SgtEase.Type.Exponential; public void SetInnerEase(SgtEase.Type value)
 {
     InnerEase = value; UpdateTextures();
 }
コード例 #7
0
 /// <summary>The transition style between the bottom and middle.</summary>
 public SgtEase.Type BottomEase = SgtEase.Type.Exponential; public void SetBottomEase(SgtEase.Type value)
 {
     BottomEase = value; UpdateTexture();
 }
コード例 #8
0
 /// <summary>The transition style between the bottom and top of the aurora.</summary>
 public SgtEase.Type MiddleEase = SgtEase.Type.Exponential; public void SetMiddleEase(SgtEase.Type value)
 {
     MiddleEase = value; UpdateTexture();
 }
コード例 #9
0
 /// <summary>The transition style between the top and middle.</summary>
 public SgtEase.Type TopEase = SgtEase.Type.Quintic; public void SetTopEase(SgtEase.Type value)
 {
     TopEase = value; UpdateTexture();
 }
コード例 #10
0
        private void WritePixel(Texture2D texture2D, float u, int x, Color baseColor, SgtEase.Type ease, float colorSharpness, float alphaSharpness)
        {
            var colorU = SgtHelper.Sharpness(u, colorSharpness); colorU = SgtEase.Evaluate(ease, colorU);
            var alphaU = SgtHelper.Sharpness(u, alphaSharpness); alphaU = SgtEase.Evaluate(ease, alphaU);

            var color = Color.Lerp(baseColor, horizonColor, colorU);

            color.a = alphaU;

            color.r = Mathf.Clamp01(color.r);
            color.g = Mathf.Clamp01(color.g);
            color.b = Mathf.Clamp01(color.b);
            color.a = Mathf.Clamp01(color.a);

            texture2D.SetPixel(x, 0, SgtHelper.Saturate(color));
        }
コード例 #11
0
 /// <summary>The ease type used for the transition.</summary>
 public SgtEase.Type Ease = SgtEase.Type.Smoothstep; public void SetEase(SgtEase.Type value)
 {
     Ease = value; UpdateTexture();
 }