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); }
/// <summary>The transition style between the day and night.</summary> [FormerlySerializedAs("nightEase")] public SgtEase.Type NightEase; public void SetNightEase(SgtEase.Type value) { NightEase = value; }
/// <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(); }
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); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }
/// <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(); }
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)); }
/// <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(); }