Ejemplo n.º 1
0
        private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
        {
            time *= 0.25f;
            float   num    = time % 1f;
            bool    num2   = time % 2f > 1f;
            Vector4 vector = num2 ? _secondaryColor : _primaryColor;
            Vector4 value  = num2 ? _primaryColor : _secondaryColor;

            num *= 1.2f;
            for (int i = 0; i < fragment.Count; i++)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
                float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.5f + new Vector2(0f, time * 0.5f));
                Vector4 value2 = vector;
                staticNoise += num;
                if (staticNoise > 0.999f)
                {
                    float amount = MathHelper.Clamp((staticNoise - 0.999f) / 0.2f, 0f, 1f);
                    value2 = Vector4.Lerp(value2, value, amount);
                }
                float dynamicNoise = NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 100f);
                dynamicNoise = Math.Max(0f, 1f - dynamicNoise * 20f);
                value2       = Vector4.Lerp(value2, _gemColors[((gridPositionOfIndex.Y * 47 + gridPositionOfIndex.X) % _gemColors.Length + _gemColors.Length) % _gemColors.Length], dynamicNoise);
                fragment.SetColor(i, value2);
                fragment.SetColor(i, value2);
            }
        }
Ejemplo n.º 2
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);
     }
 }
Ejemplo n.º 3
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         float   num1 = (float)(((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double)time * 0.400000005960464) % 10.0);
         float   num2 = 1f;
         if ((double)num1 > 1.0)
         {
             num2 = 1f - MathHelper.Clamp((float)(((double)num1 - 0.400000005960464 - 1.0) / 0.400000005960464), 0.0f, 1f);
             num1 = 1f;
         }
         float   num3    = num1 - canvasPositionOfIndex.Y / 1f;
         Vector4 vector4 = this._backgroundColor;
         if ((double)num3 > 0.0)
         {
             float num4 = 1f;
             if ((double)num3 < 0.200000002980232)
             {
                 num4 = num3 / 0.2f;
             }
             vector4 = Vector4.Lerp(this._backgroundColor, this._vineColor, num4 * num2);
         }
         fragment.SetColor(index, vector4);
     }
 }
Ejemplo n.º 4
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            float   num1    = (float)(0.5 + Math.Sin((double)time * 3.0) * 0.100000001490116);
            Vector2 vector2 = new Vector2(1.6f, 0.5f);

            for (int index = 0; index < fragment.Count; ++index)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
                Vector4 vector4 = this._backgroundColor;
                float   num2    = (float)(((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y) * 10.0 + (double)time * 2.0) % 10.0) - Math.Abs(canvasPositionOfIndex.X - vector2.X);
                if ((double)num2 > 0.0)
                {
                    float amount = Math.Max(0.0f, 1.2f - num2);
                    if ((double)num2 < 0.200000002980232)
                    {
                        amount = num2 * 5f;
                    }
                    vector4 = Vector4.Lerp(vector4, this._glowColor, amount);
                }
                float num3 = (canvasPositionOfIndex - vector2).Length();
                if ((double)num3 < (double)num1)
                {
                    float amount = 1f - MathHelper.Clamp((float)(((double)num3 - (double)num1 + 0.100000001490116) / 0.100000001490116), 0.0f, 1f);
                    vector4 = Vector4.Lerp(vector4, this._coreColor, amount);
                }
                fragment.SetColor(index, vector4);
            }
        }
Ejemplo n.º 5
0
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
         Vector4 value = _backgroundColor;
         float   num   = (NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10f + time * 0.75f) % 10f + canvasPositionOfIndex.Y - 1f;
         if (num > 0f)
         {
             float amount = Math.Max(0f, 1.2f - num);
             if (num < 0.2f)
             {
                 amount = num * 5f;
             }
             value = Vector4.Lerp(value, _skullColor, amount);
         }
         float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.5f + new Vector2(12.5f, time * 0.2f));
         staticNoise = Math.Max(0f, 1f - staticNoise * staticNoise * 4f * staticNoise * (1f - canvasPositionOfIndex.Y * canvasPositionOfIndex.Y)) * canvasPositionOfIndex.Y * canvasPositionOfIndex.Y;
         staticNoise = MathHelper.Clamp(staticNoise, 0f, 1f);
         Vector4 value2 = Vector4.Lerp(_bloodDark, _bloodLight, staticNoise);
         value = Vector4.Lerp(value, value2, staticNoise);
         fragment.SetColor(i, value);
     }
 }
Ejemplo n.º 6
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         float   num       = (float)((((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y) * 10.0 + (double)time) % 10.0 - ((double)canvasPositionOfIndex.X + 2.0)) * 0.5);
         Vector4 vector4_1 = this._backgroundColor;
         if ((double)num > 0.0)
         {
             float amount1 = Math.Max(0.0f, 1.2f - num);
             float amount2 = MathHelper.Clamp(amount1 * amount1 * amount1, 0.0f, 1f);
             if ((double)num < 0.200000002980232)
             {
                 amount1 = num / 0.2f;
             }
             Vector4 vector4_2 = Vector4.Lerp(this._spiritTrailColor, this._spiritColor, amount2);
             vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount1);
         }
         fragment.SetColor(index, vector4_1);
     }
 }
Ejemplo n.º 7
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 vector4_1             = this._backgroundColor;
         float   num = (float)(((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double)time * 0.75) % 10.0 + (double)canvasPositionOfIndex.Y - 1.0);
         if ((double)num > 0.0)
         {
             float amount = Math.Max(0.0f, 1.2f - num);
             if ((double)num < 0.200000002980232)
             {
                 amount = num * 5f;
             }
             vector4_1 = Vector4.Lerp(vector4_1, this._skullColor, amount);
         }
         float   staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.5f + new Vector2(12.5f, time * 0.2f));
         float   amount1     = MathHelper.Clamp(Math.Max(0.0f, (float)(1.0 - (double)staticNoise * (double)staticNoise * 4.0 * (double)staticNoise * (1.0 - (double)canvasPositionOfIndex.Y * (double)canvasPositionOfIndex.Y))) * canvasPositionOfIndex.Y * canvasPositionOfIndex.Y, 0.0f, 1f);
         Vector4 vector4_2   = Vector4.Lerp(this._bloodDark, this._bloodLight, amount1);
         Vector4 vector4_3   = Vector4.Lerp(vector4_1, vector4_2, amount1);
         fragment.SetColor(index, vector4_3);
     }
 }
Ejemplo n.º 8
0
        private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
        {
            float num = time * 2f;

            for (int i = 0; i < fragment.Count; i++)
            {
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
                float   staticNoise           = NoiseHelper.GetStaticNoise(gridPositionOfIndex.X);
                float   num2  = MathHelper.Max(0f, (float)Math.Cos((staticNoise + num) * ((float)Math.PI * 2f) * 0.2f));
                Vector4 value = Color.Lerp(Color.Black, Color.Indigo, 0.5f).ToVector4();
                float   num3  = Math.Max(0f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f + canvasPositionOfIndex.X * 1f));
                num3  = 0f;
                value = Vector4.Lerp(value, new Vector4(1f, 0.1f, 0.1f, 1f), num3);
                float num4 = (num2 + canvasPositionOfIndex.X + canvasPositionOfIndex.Y) % 1f;
                if (num4 > 0f)
                {
                    int num5 = (gridPositionOfIndex.X + gridPositionOfIndex.Y) % _colors.Length;
                    if (num5 < 0)
                    {
                        num5 += _colors.Length;
                    }
                    Vector4 value2 = Main.hslToRgb(((canvasPositionOfIndex.X + canvasPositionOfIndex.Y) * 0.15f + time * 0.1f) % 1f, 1f, 0.5f).ToVector4();
                    value = Vector4.Lerp(value, value2, num4);
                }
                fragment.SetColor(i, value);
            }
        }
Ejemplo n.º 9
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            Vector4 vector4_1 = !this._inBloodMoon ? new Vector4(0.0f, 0.0f, 1f, 1f) : new Vector4(1f, 0.0f, 0.0f, 1f);
            Vector4 vector4_2 = new Vector4(0.0f, 0.0f, 0.0f, 0.75f);

            for (int index = 0; index < fragment.Count; ++index)
            {
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                float   num       = (float)(((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double)time) % 10.0) - canvasPositionOfIndex.Y;
                Vector4 vector4_3 = vector4_2;
                if ((double)num > 0.0)
                {
                    float amount = Math.Max(0.0f, 1.2f - num);
                    if ((double)num < 0.200000002980232)
                    {
                        amount = num * 5f;
                    }
                    vector4_3 = Vector4.Lerp(vector4_3, vector4_1, amount);
                }
                fragment.SetColor(index, vector4_3);
            }
        }
Ejemplo n.º 10
0
        private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
        {
            float   num   = 0.5f + (float)Math.Sin(time * 3f) * 0.1f;
            Vector2 value = new Vector2(1.6f, 0.5f);

            for (int i = 0; i < fragment.Count; i++)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
                Vector4 vector = _backgroundColor;
                float   num2   = (NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y) * 10f + time * 2f) % 10f - Math.Abs(canvasPositionOfIndex.X - value.X);
                if (num2 > 0f)
                {
                    float amount = Math.Max(0f, 1.2f - num2);
                    if (num2 < 0.2f)
                    {
                        amount = num2 * 5f;
                    }
                    vector = Vector4.Lerp(vector, _glowColor, amount);
                }
                float num3 = (canvasPositionOfIndex - value).Length();
                if (num3 < num)
                {
                    float amount2 = 1f - MathHelper.Clamp((num3 - num + 0.1f) / 0.1f, 0f, 1f);
                    vector = Vector4.Lerp(vector, _coreColor, amount2);
                }
                fragment.SetColor(i, vector);
            }
        }
Ejemplo n.º 11
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         Vector4 vector4_1             = this._baseColor;
         float   num = (float)((((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double)time * 0.200000002980232) % 10.0 - (1.0 - (double)canvasPositionOfIndex.Y)) * 2.0);
         if ((double)num > 0.0)
         {
             float amount = Math.Max(0.0f, 1.5f - num);
             if ((double)num < 0.5)
             {
                 amount = num * 2f;
             }
             vector4_1 = Vector4.Lerp(vector4_1, this._sporeColor, amount);
         }
         float   amount1   = Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(0.0f, time * 0.1f)) * (1.0 + (1.0 - (double)canvasPositionOfIndex.Y) * 4.0))) * Math.Max(0.0f, (float)(((double)canvasPositionOfIndex.Y - 0.300000011920929) / 0.699999988079071));
         Vector4 vector4_2 = Vector4.Lerp(vector4_1, this._edgeGlowColor, amount1);
         fragment.SetColor(index, vector4_2);
     }
 }
Ejemplo n.º 12
0
 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);
         gridPositionOfIndex.X /= 2;
         float num    = (NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 40f + time * 1f) % 40f;
         float amount = 0f;
         float num2   = num - canvasPositionOfIndex.Y / 1.2f;
         if (num > 1f)
         {
             float num3 = 1f - canvasPositionOfIndex.Y / 1.2f;
             amount = (1f - Math.Min(1f, num2 - num3)) * (1f - Math.Min(1f, num3 / 1f));
         }
         Vector4 vector = _backgroundColor;
         if (num2 > 0f)
         {
             float amount2 = Math.Max(0f, 1.2f - num2 * 4f);
             if (num2 < 0.1f)
             {
                 amount2 = num2 / 0.1f;
             }
             vector = Vector4.Lerp(vector, _cannonBallColor, amount2);
             vector = Vector4.Lerp(vector, _splashColor, amount);
         }
         if (canvasPositionOfIndex.Y > 0.8f)
         {
             vector = _waterColor;
         }
         fragment.SetColor(i, vector);
     }
 }
Ejemplo n.º 13
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            time *= 0.25f;
            float   num1      = time % 1f;
            int     num2      = (double)time % 2.0 > 1.0 ? 1 : 0;
            Vector4 vector4_1 = num2 != 0 ? this._secondaryColor : this._primaryColor;
            Vector4 vector4_2 = num2 != 0 ? this._primaryColor : this._secondaryColor;
            float   num3      = num1 * 1.2f;

            for (int index = 0; index < fragment.Count; ++index)
            {
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index);
                float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.5f + new Vector2(0.0f, time * 0.5f));
                Vector4 vector4_3             = vector4_1;
                float   num4 = staticNoise + num3;
                if ((double)num4 > 0.999000012874603)
                {
                    float amount = MathHelper.Clamp((float)(((double)num4 - 0.999000012874603) / 0.200000002980232), 0.0f, 1f);
                    vector4_3 = Vector4.Lerp(vector4_3, vector4_2, amount);
                }
                float   amount1   = Math.Max(0.0f, (float)(1.0 - (double)NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 100f) * 20.0));
                Vector4 vector4_4 = Vector4.Lerp(vector4_3, GemCaveShader._gemColors[((gridPositionOfIndex.Y * 47 + gridPositionOfIndex.X) % GemCaveShader._gemColors.Length + GemCaveShader._gemColors.Length) % GemCaveShader._gemColors.Length], amount1);
                fragment.SetColor(index, vector4_4);
                fragment.SetColor(index, vector4_4);
            }
        }
        private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
        {
            Vector4 vector = _skyColor * _lightColor;

            for (int i = 0; i < fragment.Count; i++)
            {
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
                float   staticNoise           = NoiseHelper.GetStaticNoise(gridPositionOfIndex.X);
                staticNoise = (staticNoise * 10f + time * 0.4f) % 10f;
                float num = 1f;
                if (staticNoise > 1f)
                {
                    num         = MathHelper.Clamp(1f - (staticNoise - 1.4f), 0f, 1f);
                    staticNoise = 1f;
                }
                float   num2    = (float)Math.Sin(canvasPositionOfIndex.X) * 0.3f + 0.7f;
                float   num3    = staticNoise - (1f - canvasPositionOfIndex.Y);
                Vector4 vector2 = vector;
                if (num3 > 0f)
                {
                    float num4 = 1f;
                    if (num3 < 0.2f)
                    {
                        num4 = num3 * 5f;
                    }
                    vector2 = Vector4.Lerp(vector2, _baseColor, num4 * num);
                }
                if (canvasPositionOfIndex.Y > num2)
                {
                    vector2 = _baseColor;
                }
                fragment.SetColor(i, vector2);
            }
        }
Ejemplo n.º 15
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            time *= this._speed * 0.5f;
            float   num1      = time % 1f;
            int     num2      = (double)time % 2.0 > 1.0 ? 1 : 0;
            Vector4 vector4_1 = num2 != 0 ? this._frontColor : this._backColor;
            Vector4 vector4_2 = num2 != 0 ? this._backColor : this._frontColor;
            float   num3      = num1 * 1.2f;

            for (int index = 0; index < fragment.Count; ++index)
            {
                float   staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.5f + new Vector2(0.0f, time * 0.5f));
                Vector4 vector4_3   = vector4_1;
                float   num4        = staticNoise + num3;
                if ((double)num4 > 0.999000012874603)
                {
                    float amount = MathHelper.Clamp((float)(((double)num4 - 0.999000012874603) / 0.200000002980232), 0.0f, 1f);
                    vector4_3 = Vector4.Lerp(vector4_3, vector4_2, amount);
                }
                fragment.SetColor(index, vector4_3);
            }
        }
Ejemplo n.º 16
0
        private void ProcessHighDetail(
            RgbDevice device,
            Fragment fragment,
            EffectDetailLevel quality,
            float time)
        {
            Vector4 vector4_1 = new Vector4(0.0f, 0.0f, 0.0f, 0.75f);

            for (int index1 = 0; index1 < fragment.Count; ++index1)
            {
                Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(index1);
                Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index1);
                float   num       = (float)(((double)NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 7.0 + (double)time * 0.400000005960464) % 7.0) - canvasPositionOfIndex.Y;
                Vector4 vector4_2 = vector4_1;
                if ((double)num > 0.0)
                {
                    float amount = Math.Max(0.0f, 1.2f - num);
                    if ((double)num < 0.400000005960464)
                    {
                        amount = num / 0.4f;
                    }
                    int index2 = (gridPositionOfIndex.X % SlimeRainShader._colors.Length + SlimeRainShader._colors.Length) % SlimeRainShader._colors.Length;
                    vector4_2 = Vector4.Lerp(vector4_2, SlimeRainShader._colors[index2], amount);
                }
                fragment.SetColor(index1, vector4_2);
            }
        }
Ejemplo n.º 17
0
		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);
				float staticNoise = NoiseHelper.GetStaticNoise(gridPositionOfIndex.X);
				staticNoise = (staticNoise * 10f + time * 0.4f) % 10f;
				float num = 1f;
				if (staticNoise > 1f)
				{
					num = 1f - MathHelper.Clamp((staticNoise - 0.4f - 1f) / 0.4f, 0f, 1f);
					staticNoise = 1f;
				}
				float num2 = staticNoise - canvasPositionOfIndex.Y / 1f;
				Vector4 vector = _backgroundColor;
				if (num2 > 0f)
				{
					float num3 = 1f;
					if (num2 < 0.2f)
					{
						num3 = num2 / 0.2f;
					}
					vector = Vector4.Lerp(_backgroundColor, _vineColor, num3 * num);
				}
				fragment.SetColor(i, vector);
			}
		}
Ejemplo n.º 18
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));
        }
Ejemplo n.º 19
0
 private void ProcessLowDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         float staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(i) * 0.3f + new Vector2(12.5f, time * 0.2f));
         staticNoise = Math.Max(0f, 1f - staticNoise * staticNoise * 4f * staticNoise);
         staticNoise = MathHelper.Clamp(staticNoise, 0f, 1f);
         Vector4 vector = Vector4.Lerp(_primaryColor, _secondaryColor, staticNoise);
         fragment.SetColor(i, vector);
     }
 }
Ejemplo n.º 20
0
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         fragment.GetGridPositionOfIndex(i);
         canvasPositionOfIndex.Y += (float)Math.Sin(canvasPositionOfIndex.X * 2f + time * 2f) * 0.2f;
         float   staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * new Vector2(0.1f, 0.5f));
         Vector4 vector      = Vector4.Lerp(_baseColor, _sandColor, staticNoise * staticNoise);
         fragment.SetColor(i, vector);
     }
 }
Ejemplo n.º 21
0
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         fragment.GetGridPositionOfIndex(i);
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * new Vector2(0.7f * _viscosity, 0.075f) + new Vector2(0f, time * -0.1f * _viscosity));
         staticNoise = Math.Max(0f, 1f - (canvasPositionOfIndex.Y * 4.5f + 0.5f) * staticNoise);
         Vector4 baseColor = _baseColor;
         baseColor = Vector4.Lerp(baseColor, _liquidColor, staticNoise);
         fragment.SetColor(i, baseColor);
     }
 }
Ejemplo n.º 22
0
 private void ProcessLowDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         float   staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(12.5f, time * 0.2f));
         Vector4 vector4     = Vector4.Lerp(this._primaryColor, this._secondaryColor, MathHelper.Clamp(Math.Max(0.0f, (float)(1.0 - (double)staticNoise * (double)staticNoise * 4.0 * (double)staticNoise)), 0.0f, 1f));
         fragment.SetColor(index, vector4);
     }
 }
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f));
         staticNoise = Math.Max(0f, 1f - staticNoise * staticNoise * 4f * staticNoise * (1.2f - canvasPositionOfIndex.Y)) * canvasPositionOfIndex.Y * canvasPositionOfIndex.Y;
         staticNoise = MathHelper.Clamp(staticNoise, 0f, 1f);
         Vector4 value = Vector4.Lerp(_primaryColor, _secondaryColor, staticNoise);
         value = Vector4.Lerp(value, Vector4.One, staticNoise * staticNoise * staticNoise);
         Vector4 vector = Vector4.Lerp(new Vector4(0f, 0f, 0f, 1f), value, staticNoise);
         fragment.SetColor(i, vector);
     }
 }
Ejemplo n.º 24
0
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     new Vector2(1.6f, 0.5f);
     for (int i = 0; i < fragment.Count; i++)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         Vector4 slimeColor            = _slimeColor;
         float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(0f, time * 0.1f));
         staticNoise = Math.Max(0f, 1f - staticNoise * 3f);
         staticNoise = (float)Math.Sqrt(staticNoise);
         slimeColor  = Vector4.Lerp(slimeColor, _debrisColor, staticNoise);
         fragment.SetColor(i, slimeColor);
     }
 }
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     //IL_0000: Unknown result type (might be due to invalid IL or missing references)
     if ((int)quality == 0)
     {
         time *= 0.25f;
     }
     for (int i = 0; i < fragment.Count; i++)
     {
         float   staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(i) * new Vector2(0.2f, 0.4f) + new Vector2(time * 0.35f, time * -0.35f));
         Vector4 vector      = Vector4.Lerp(_backColor, _frontColor, staticNoise * staticNoise);
         fragment.SetColor(i, vector);
     }
 }
Ejemplo n.º 26
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     for (int index = 0; index < fragment.Count; ++index)
     {
         fragment.GetGridPositionOfIndex(index);
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index);
         float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * new Vector2(0.7f * this._viscosity, 0.075f) + new Vector2(0.0f, time * -0.1f * this._viscosity));
         Vector4 vector4 = Vector4.Lerp(this._baseColor, this._liquidColor, Math.Max(0.0f, (float)(1.0 - ((double)canvasPositionOfIndex.Y * 4.5 + 0.5) * (double)staticNoise)));
         fragment.SetColor(index, vector4);
     }
 }
Ejemplo n.º 27
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);
         float   staticNoise           = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f));
         float   amount  = MathHelper.Clamp(Math.Max(0.0f, (float)(1.0 - (double)staticNoise * (double)staticNoise * 4.0 * (double)staticNoise * (1.20000004768372 - (double)canvasPositionOfIndex.Y))) * canvasPositionOfIndex.Y * canvasPositionOfIndex.Y, 0.0f, 1f);
         Vector4 vector4 = Vector4.Lerp(new Vector4(0.0f, 0.0f, 0.0f, 1f), Vector4.Lerp(Vector4.Lerp(this._primaryColor, this._secondaryColor, amount), Vector4.One, amount * amount * amount), amount);
         fragment.SetColor(index, vector4);
     }
 }
Ejemplo n.º 28
0
 private void ProcessHighDetail(
     RgbDevice device,
     Fragment fragment,
     EffectDetailLevel quality,
     float time)
 {
     if (quality == null)
     {
         time *= 0.25f;
     }
     for (int index = 0; index < fragment.Count; ++index)
     {
         Vector4 vector4 = Vector4.Lerp(this._backColor, this._frontColor, NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(time, -time) * 0.5f));
         fragment.SetColor(index, vector4);
     }
 }
Ejemplo n.º 29
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);
         fragment.GetGridPositionOfIndex(index);
         canvasPositionOfIndex.Y += (float)Math.Sin((double)canvasPositionOfIndex.X * 2.0 + (double)time * 2.0) * 0.2f;
         float   staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * new Vector2(0.1f, 0.5f));
         Vector4 vector4     = Vector4.Lerp(this._baseColor, this._sandColor, staticNoise * staticNoise);
         fragment.SetColor(index, vector4);
     }
 }
Ejemplo n.º 30
0
 private void ProcessHighDetail(RgbDevice device, Fragment fragment, EffectDetailLevel quality, float time)
 {
     for (int i = 0; i < fragment.Count; i++)
     {
         Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
         Point   gridPositionOfIndex   = fragment.GetGridPositionOfIndex(i);
         Vector4 vector = _backgroundColor;
         float   num    = (NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y * 7) * 10f + time) % 10f - (canvasPositionOfIndex.X + 2f);
         if (num > 0f)
         {
             float amount = Math.Max(0f, 1.2f - num);
             if (num < 0.2f)
             {
                 amount = num * 5f;
             }
             vector = Vector4.Lerp(vector, _glowColor, amount);
         }
         fragment.SetColor(i, vector);
     }
 }