Example #1
0
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     time *= 2f;
     for (int i = 0; i < fragment.Count; i++)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         Vector4 backgroundColor       = _backgroundColor;
         float   num   = time * 0.5f + canvasPositionOfIndex.X + canvasPositionOfIndex.Y;
         float   value = (float)Math.Cos(num) * 2f + 2f;
         value = MathHelper.Clamp(value, 0f, 1f);
         num   = (num + (float)Math.PI) % ((float)Math.PI * 6f);
         Vector4 value2;
         if (num < (float)Math.PI * 2f)
         {
             float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f));
             staticNoise = Math.Max(0f, 1f - staticNoise * staticNoise * 4f * staticNoise);
             staticNoise = MathHelper.Clamp(staticNoise, 0f, 1f);
             value2      = Vector4.Lerp(_fireDarkColor, _fireBrightColor, staticNoise);
         }
         else if (num < (float)Math.PI * 4f)
         {
             float dynamicNoise = NoiseHelper.GetDynamicNoise(new Vector2((canvasPositionOfIndex.X + canvasPositionOfIndex.Y) * 0.2f, 0f), time / 5f);
             dynamicNoise = Math.Max(0f, 1f - dynamicNoise * 1.5f);
             value2       = Vector4.Lerp(_iceDarkColor, _iceBrightColor, dynamicNoise);
         }
         else
         {
             float dynamicNoise2 = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.15f, time * 0.05f);
             dynamicNoise2 = (float)Math.Sin(dynamicNoise2 * 15f) * 0.5f + 0.5f;
             dynamicNoise2 = Math.Max(0f, 1f - 5f * dynamicNoise2);
             value2        = Vector4.Lerp(_lightningDarkColor, _lightningBrightColor, dynamicNoise2);
         }
         backgroundColor = Vector4.Lerp(backgroundColor, value2, value);
         fragment.SetColor(i, backgroundColor);
     }
 }
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         Vector4 value = _baseColor;
         float   num   = ((NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10f + time * 0.2f) % 10f - (1f - canvasPositionOfIndex.Y)) * 2f;
         if (num > 0f)
         {
             float amount = Math.Max(0f, 1.5f - num);
             if (num < 0.5f)
             {
                 amount = num * 2f;
             }
             value = Vector4.Lerp(value, _sporeColor, amount);
         }
         float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(0f, time * 0.1f));
         staticNoise  = Math.Max(0f, 1f - staticNoise * (1f + (1f - canvasPositionOfIndex.Y) * 4f));
         staticNoise *= Math.Max(0f, (canvasPositionOfIndex.Y - 0.3f) / 0.7f);
         value        = Vector4.Lerp(value, _edgeGlowColor, staticNoise);
         fragment.SetColor(i, value);
     }
 }
Example #3
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector4 vector4 = Vector4.Lerp(this._secondaryColor, this._primaryColor, (float)Math.Sqrt((double)Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f, time / 5f) * 2.0))) * 0.75f);
         fragment.SetColor(index, vector4);
     }
 }
Example #4
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            Vector4 vector4_1 = this._primaryColor * this._surfaceColor;
            Vector4 vector4_2 = this._secondaryColor * this._surfaceColor;

            for (int index = 0; index < fragment.Count; ++index)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
                float   amount    = (float)(Math.Sin((double)canvasPositionOfIndex.X * 1.5 + (double)canvasPositionOfIndex.Y + (double)time) * 0.5 + 0.5);
                Vector4 vector4_3 = Vector4.Max(Vector4.Lerp(vector4_1, vector4_2, amount), new Vector4(Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 60f) * 20.0)) * (1f - this._surfaceColor.X) * this._starVisibility));
                fragment.SetColor(index, vector4_3);
            }
        }
Example #5
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            float num1 = time * 2f;

            for (int index = 0; index < fragment.Count; ++index)
            {
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                double  num2      = (double)MathHelper.Max(0.0f, (float)Math.Cos(((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) + (double)num1) * 6.28318548202515 * 0.200000002980232));
                Vector4 vector4_1 = Color.Lerp(Color.Black, Color.Indigo, 0.5f).ToVector4();
                Math.Max(0.0f, (float)Math.Sin((double)Main.GlobalTimeWrappedHourly * 2.0 + (double)canvasPositionOfIndex.X * 1.0));
                float   amount1   = 0.0f;
                Vector4 vector4_2 = Vector4.Lerp(vector4_1, new Vector4(1f, 0.1f, 0.1f, 1f), amount1);
                double  x         = (double)canvasPositionOfIndex.X;
                float   amount2   = (float)((num2 + x + (double)canvasPositionOfIndex.Y) % 1.0);
                if ((double)amount2 > 0.0)
                {
                    int num3 = (gridPositionOfIndex.X + gridPositionOfIndex.Y) % EmpressShader._colors.Length;
                    if (num3 < 0)
                    {
                        int num4 = num3 + EmpressShader._colors.Length;
                    }
                    Vector4 vector4_3 = Main.hslToRgb((float)((((double)canvasPositionOfIndex.X + (double)canvasPositionOfIndex.Y) * 0.150000005960464 + (double)time * 0.100000001490116) % 1.0), 1f, 0.5f).ToVector4();
                    vector4_2 = Vector4.Lerp(vector4_2, vector4_3, amount2);
                }
                fragment.SetColor(index, vector4_2);
            }
        }
Example #6
0
        private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
        {
            //IL_0001: Unknown result type (might be due to invalid IL or missing references)
            //IL_0009: Unknown result type (might be due to invalid IL or missing references)
            //IL_000f: Invalid comparison between Unknown and I4
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            if ((int)device.Type != 0 && (int)device.Type != 6)
            {
                ProcessLowDetail(device, fragment, quality, time);
                return;
            }
            bool  flag = true;
            float num  = time * 0.1f % 2f;

            if (num > 1f)
            {
                num  = 2f - num;
                flag = false;
            }
            Vector2 vector = new Vector2(num * 7f - 3.5f, 0f) + fragment.get_CanvasCenter();

            for (int i = 0; i < fragment.Count; i++)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
                Vector4 vector2 = _backgroundColor;
                Vector2 vector3 = canvasPositionOfIndex - vector;
                float   num2    = vector3.Length();
                if (num2 < 0.5f)
                {
                    float amount = 1f - MathHelper.Clamp((num2 - 0.5f + 0.2f) / 0.2f, 0f, 1f);
                    float num3   = MathHelper.Clamp((vector3.X + 0.5f - 0.2f) / 0.6f, 0f, 1f);
                    if (flag)
                    {
                        num3 = 1f - num3;
                    }
                    Vector4 value  = Vector4.Lerp(_eyeColor, _veinColor, num3);
                    float   value2 = (float)Math.Atan2(vector3.Y, vector3.X);
                    if (!flag && (float)Math.PI - Math.Abs(value2) < 0.6f)
                    {
                        value = _mouthColor;
                    }
                    vector2 = Vector4.Lerp(vector2, value, amount);
                }
                if (flag && gridPositionOfIndex.Y == 3 && canvasPositionOfIndex.X > vector.X)
                {
                    float value3 = 1f - Math.Abs(canvasPositionOfIndex.X - vector.X * 2f - 0.5f) / 0.5f;
                    vector2 = Vector4.Lerp(vector2, _laserColor, MathHelper.Clamp(value3, 0f, 1f));
                }
                else if (!flag)
                {
                    Vector2 vector4 = canvasPositionOfIndex - (vector - new Vector2(1.2f, 0f));
                    vector4.Y *= 3.5f;
                    float num4 = vector4.Length();
                    if (num4 < 0.7f)
                    {
                        float dynamicNoise = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex, time);
                        dynamicNoise  = dynamicNoise * dynamicNoise * dynamicNoise;
                        dynamicNoise *= 1f - MathHelper.Clamp((num4 - 0.7f + 0.3f) / 0.3f, 0f, 1f);
                        vector2       = Vector4.Lerp(vector2, _flameColor, dynamicNoise);
                    }
                }
                fragment.SetColor(i, vector2);
            }
        }
Example #7
0
        public static float GetDynamicNoise(Vector2 position, float currentTime)
        {
            position    *= 10f;
            currentTime %= 1f;
            Vector2 vector2_1 = new Vector2((float)Math.Floor((double)position.X), (float)Math.Floor((double)position.Y));
            Point   point     = new Point((int)vector2_1.X, (int)vector2_1.Y);
            Vector2 vector2_2 = new Vector2(position.X - vector2_1.X, position.Y - vector2_1.Y);

            return(MathHelper.Lerp(MathHelper.Lerp(NoiseHelper.GetDynamicNoiseInternal(point.X, point.Y, currentTime), NoiseHelper.GetDynamicNoiseInternal(point.X, point.Y + 1, currentTime), vector2_2.Y), MathHelper.Lerp(NoiseHelper.GetDynamicNoiseInternal(point.X + 1, point.Y, currentTime), NoiseHelper.GetDynamicNoiseInternal(point.X + 1, point.Y + 1, currentTime), vector2_2.Y), vector2_2.X));
        }
Example #8
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
         Vector4 baseColor             = this._baseColor;
         float   dynamicNoise          = NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 10f);
         Vector4 vector4 = Vector4.Lerp(Vector4.Lerp(baseColor, this._secondaryColor, dynamicNoise * dynamicNoise), this._glowColor, (float)Math.Sqrt((double)Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.5f + new Vector2(0.0f, time * 0.05f), time / 20f) * 2.0))) * 0.75f);
         fragment.SetColor(index, vector4);
     }
 }
Example #9
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         Vector4 vector4 = Vector4.Lerp(Vector4.Lerp(this._baseColor, this._iceColor, Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(new Vector2((float)(((double)canvasPositionOfIndex.X - (double)canvasPositionOfIndex.Y) * 0.200000002980232), 0.0f), time / 5f) * 1.5))), this._shineColor, Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(new Vector2((float)(((double)canvasPositionOfIndex.X - (double)canvasPositionOfIndex.Y) * 0.300000011920929), 0.3f), time / 20f) * 5.0)));
         fragment.SetColor(index, vector4);
     }
 }
Example #10
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     if (device.Type != null && (int)device.Type != 6)
     {
         this.ProcessLowDetail(device, fragment, quality, time);
     }
     else
     {
         bool  flag = true;
         float num1 = (float)((double)time * 0.100000001490116 % 2.0);
         if ((double)num1 > 1.0)
         {
             num1 = 2f - num1;
             flag = false;
         }
         Vector2 vector2_1 = new Vector2((float)((double)num1 * 7.0 - 3.5), 0.0f) + fragment.CanvasCenter;
         for (int index = 0; index < fragment.Count; ++index)
         {
             Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
             Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
             Vector4 vector4_1             = this._backgroundColor;
             Vector2 vector2_2             = canvasPositionOfIndex - vector2_1;
             float   num2 = vector2_2.Length();
             if ((double)num2 < 0.5)
             {
                 float amount1 = 1f - MathHelper.Clamp((float)(((double)num2 - 0.5 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f);
                 float amount2 = MathHelper.Clamp((float)(((double)vector2_2.X + 0.5 - 0.200000002980232) / 0.600000023841858), 0.0f, 1f);
                 if (flag)
                 {
                     amount2 = 1f - amount2;
                 }
                 Vector4 vector4_2 = Vector4.Lerp(this._eyeColor, this._veinColor, amount2);
                 float   num3      = (float)Math.Atan2((double)vector2_2.Y, (double)vector2_2.X);
                 if (!flag && 3.14159274101257 - (double)Math.Abs(num3) < 0.600000023841858)
                 {
                     vector4_2 = this._mouthColor;
                 }
                 vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount1);
             }
             if (flag && gridPositionOfIndex.Y == 3 && (double)canvasPositionOfIndex.X > (double)vector2_1.X)
             {
                 float num3 = (float)(1.0 - (double)Math.Abs((float)((double)canvasPositionOfIndex.X - (double)vector2_1.X * 2.0 - 0.5)) / 0.5);
                 vector4_1 = Vector4.Lerp(vector4_1, this._laserColor, MathHelper.Clamp(num3, 0.0f, 1f));
             }
             else if (!flag)
             {
                 Vector2 vector2_3 = canvasPositionOfIndex - (vector2_1 - new Vector2(1.2f, 0.0f));
                 vector2_3.Y *= 3.5f;
                 float num3 = vector2_3.Length();
                 if ((double)num3 < 0.699999988079071)
                 {
                     float dynamicNoise = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex, time);
                     float amount       = dynamicNoise * dynamicNoise * dynamicNoise * (1f - MathHelper.Clamp((float)(((double)num3 - 0.699999988079071 + 0.300000011920929) / 0.300000011920929), 0.0f, 1f));
                     vector4_1 = Vector4.Lerp(vector4_1, this._flameColor, amount);
                 }
             }
             fragment.SetColor(index, vector4_1);
         }
     }
 }
Example #11
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     if (device.Type != null && device.Type != 6)
     {
         this.ProcessLowDetail(device, fragment, quality, time);
     }
     else
     {
         Vector2 vector2_1 = new Vector2(2f, 0.5f);
         Vector2 vector2_2 = new Vector2(2.5f, 1f);
         float   num1      = (float)((double)this._progress * 3.14159274101257 + 3.14159274101257);
         Vector2 vector2_3 = new Vector2((float)Math.Cos((double)num1), (float)Math.Sin((double)num1)) * vector2_2 + vector2_1;
         for (int index = 0; index < fragment.Count; ++index)
         {
             Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
             float   num2    = (float)Math.Sqrt((double)Math.Max(0.0f, (float)(1.0 - 2.0 * (double)NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * new Vector2(0.1f, 0.5f) + new Vector2(time * 0.02f, 0.0f), time / 40f))));
             float   num3    = (canvasPositionOfIndex - vector2_3).Length();
             Vector4 vector4 = Vector4.Lerp(this._skyColor, this._cloudColor, num2 * 0.15f);
             if ((double)num3 < 0.800000011920929)
             {
                 vector4 = Vector4.Lerp(this._moonRingColor, this._moonCoreColor, Math.Min(0.1f, 0.8f - num3) / 0.1f);
             }
             else if ((double)num3 < 1.0)
             {
                 vector4 = Vector4.Lerp(vector4, this._moonRingColor, Math.Min(0.2f, 1f - num3) / 0.2f);
             }
             fragment.SetColor(index, vector4);
         }
     }
 }
Example #12
0
 private void ProcessLowDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector4 vector4 = Vector4.Lerp(this._skyColor, this._cloudColor, (float)Math.Sqrt((double)Math.Max(0.0f, (float)(1.0 - 2.0 * (double)NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * new Vector2(0.1f, 0.5f) + new Vector2(time * 0.02f, 0.0f), time / 40f)))) * 0.1f);
         fragment.SetColor(index, vector4);
     }
 }
Example #13
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            bool flag = device.Type == null || device.Type == 6;

            for (int index = 0; index < fragment.Count; ++index)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
                Vector4 vector4 = Vector4.Lerp(this._backgroundColor, this._sporeColor, Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.3f, time / 5f) * 2.5)));
                if (flag)
                {
                    float amount = Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 100f) * 20.0));
                    vector4 = Vector4.Lerp(vector4, this._flowerColors[((gridPositionOfIndex.Y * 47 + gridPositionOfIndex.X) % 5 + 5) % 5], amount);
                }
                fragment.SetColor(index, vector4);
            }
        }
Example #14
0
 private void ProcessLowDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector4 vector4 = Vector4.Lerp(this._backgroundColor, this._sporeColor, NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f, time / 5f));
         fragment.SetColor(index, vector4);
     }
 }
Example #15
0
 private void ProcessLowDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector4 vector4 = Vector4.Lerp(this._slimeColor, this._debrisColor, Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index), time * 0.25f) * 2.0)));
         fragment.SetColor(index, vector4);
     }
 }
Example #16
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            Vector2 vector2 = new Vector2(1.6f, 0.5f);

            for (int index = 0; index < fragment.Count; ++index)
            {
                Vector4 vector4 = Vector4.Lerp(this._slimeColor, this._debrisColor, (float)Math.Sqrt((double)Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(0.0f, time * 0.1f)) * 3.0))));
                fragment.SetColor(index, vector4);
            }
        }
Example #17
0
 private void ProcessAnyDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
         Vector2 vector2 = new Vector2(0.1f, 0.5f);
         Vector4 vector4 = Vector4.Lerp(Vector4.Lerp(this._baseSpaceColor, Vector4.Lerp(this._processedSkyColor, this._processedCloudColor, (float)Math.Sqrt((double)Math.Max(0.0f, (float)(1.0 - 2.0 * (double)NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * vector2 + new Vector2(time * 0.05f, 0.0f), time / 20f))))), this._backgroundTransition), Vector4.One, Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 60f) * 20.0)) * 0.98f * this._starVisibility);
         fragment.SetColor(index, vector4);
     }
 }
Example #18
0
 public static float GetDynamicNoise(int x, int y, float currentTime)
 {
     return(NoiseHelper.GetDynamicNoiseInternal(x, y, currentTime % 1f));
 }
Example #19
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            Vector2 vector2   = new Vector2(1.6f, 0.5f);
            Vector4 vector4_1 = Vector4.Lerp(this._brainColor, this._veinColor, (float)((double)Math.Max(0.0f, (float)Math.Sin((double)time * 3.0)) * 0.5 + 0.5));

            for (int index = 0; index < fragment.Count; ++index)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                Vector4 brainColor            = this._brainColor;
                float   amount    = Math.Max(0.0f, (float)(1.0 - 5.0 * (Math.Sin((double)NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.15f + new Vector2(time * (1f / 500f)), time * 0.03f) * 10.0) * 0.5 + 0.5)));
                Vector4 vector4_2 = Vector4.Lerp(brainColor, vector4_1, amount);
                fragment.SetColor(index, vector4_2);
            }
        }
Example #20
0
        public static float GetStaticNoise(Vector2 position)
        {
            position *= 10f;
            Vector2 vector2_1 = new Vector2((float)Math.Floor((double)position.X), (float)Math.Floor((double)position.Y));
            Point   point     = new Point((int)vector2_1.X, (int)vector2_1.Y);
            Vector2 vector2_2 = new Vector2(position.X - vector2_1.X, position.Y - vector2_1.Y);

            return(MathHelper.Lerp(MathHelper.Lerp(NoiseHelper.GetStaticNoise(point.X, point.Y), NoiseHelper.GetStaticNoise(point.X, point.Y + 1), vector2_2.Y), MathHelper.Lerp(NoiseHelper.GetStaticNoise(point.X + 1, point.Y), NoiseHelper.GetStaticNoise(point.X + 1, point.Y + 1), vector2_2.Y), vector2_2.X));
        }
Example #21
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     time *= 2f;
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         Vector4 backgroundColor       = this._backgroundColor;
         float   num1   = time * 0.5f + canvasPositionOfIndex.X + canvasPositionOfIndex.Y;
         float   amount = MathHelper.Clamp((float)(Math.Cos((double)num1) * 2.0 + 2.0), 0.0f, 1f);
         float   num2   = (float)(((double)num1 + 3.14159274101257) % 18.8495559692383);
         Vector4 vector4_1;
         if ((double)num2 < 6.28318548202515)
         {
             float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f));
             vector4_1 = Vector4.Lerp(this._fireDarkColor, this._fireBrightColor, MathHelper.Clamp(Math.Max(0.0f, (float)(1.0 - (double)staticNoise * (double)staticNoise * 4.0 * (double)staticNoise)), 0.0f, 1f));
         }
         else
         {
             vector4_1 = (double)num2 >= 12.5663709640503 ? Vector4.Lerp(this._lightningDarkColor, this._lightningBrightColor, Math.Max(0.0f, (float)(1.0 - 5.0 * (Math.Sin((double)NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.15f, time * 0.05f) * 15.0) * 0.5 + 0.5)))) : Vector4.Lerp(this._iceDarkColor, this._iceBrightColor, Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(new Vector2((float)(((double)canvasPositionOfIndex.X + (double)canvasPositionOfIndex.Y) * 0.200000002980232), 0.0f), time / 5f) * 1.5)));
         }
         Vector4 vector4_2 = Vector4.Lerp(backgroundColor, vector4_1, amount);
         fragment.SetColor(index, vector4_2);
     }
 }