Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ProcessHighDetail()

void Terraria.GameContent.RGB.IceShader.ProcessHighDetail ( RgbDevice device,
Fragment fragment,
EffectDetailLevel quality,
float time )
inlineprivate

Definition at line 22 of file IceShader.cs.

23 {
24 for (int i = 0; i < fragment.Count; i++)
25 {
26 Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
27 float dynamicNoise = NoiseHelper.GetDynamicNoise(new Vector2((canvasPositionOfIndex.X - canvasPositionOfIndex.Y) * 0.2f, 0f), time / 5f);
28 dynamicNoise = Math.Max(0f, 1f - dynamicNoise * 1.5f);
29 float dynamicNoise2 = NoiseHelper.GetDynamicNoise(new Vector2((canvasPositionOfIndex.X - canvasPositionOfIndex.Y) * 0.3f, 0.3f), time / 20f);
30 dynamicNoise2 = Math.Max(0f, 1f - dynamicNoise2 * 5f);
31 Vector4 value = Vector4.Lerp(_baseColor, _iceColor, dynamicNoise);
32 value = Vector4.Lerp(value, _shineColor, dynamicNoise2);
33 fragment.SetColor(i, value);
34 }
35 }
void SetColor(int index, Vector4 color)
Definition Fragment.cs:97
Vector2 GetCanvasPositionOfIndex(int index)
Definition Fragment.cs:75
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static Vector4 Lerp(Vector4 value1, Vector4 value2, float amount)
Definition Vector4.cs:277

References Terraria.GameContent.RGB.IceShader._baseColor, Terraria.GameContent.RGB.IceShader._iceColor, Terraria.GameContent.RGB.IceShader._shineColor, ReLogic.Peripherals.RGB.Fragment.Count, ReLogic.Peripherals.RGB.Fragment.GetCanvasPositionOfIndex(), Terraria.GameContent.RGB.NoiseHelper.GetDynamicNoise(), Microsoft.Xna.Framework.Vector4.Lerp(), System.Math.Max(), ReLogic.Peripherals.RGB.Fragment.SetColor(), System.value, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.