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

◆ ProcessHighDetail()

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

Definition at line 27 of file UndergroundHallowShader.cs.

28 {
29 for (int i = 0; i < fragment.Count; i++)
30 {
31 fragment.GetGridPositionOfIndex(i);
32 Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
33 Vector4 baseColor = _baseColor;
34 float dynamicNoise = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.4f, time * 0.05f);
35 dynamicNoise = Math.Max(0f, 1f - 2.5f * dynamicNoise);
36 float dynamicNoise2 = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.4f + new Vector2(0.05f, 0f), time * 0.05f);
37 dynamicNoise2 = Math.Max(0f, 1f - 2.5f * dynamicNoise2);
38 baseColor = ((!(dynamicNoise > dynamicNoise2)) ? Vector4.Lerp(baseColor, _blueCrystalColor, dynamicNoise2) : Vector4.Lerp(baseColor, _pinkCrystalColor, dynamicNoise));
39 fragment.SetColor(i, baseColor);
40 }
41 }
Point GetGridPositionOfIndex(int index)
Definition Fragment.cs:81
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.UndergroundHallowShader._baseColor, Terraria.GameContent.RGB.UndergroundHallowShader._blueCrystalColor, Terraria.GameContent.RGB.UndergroundHallowShader._pinkCrystalColor, ReLogic.Peripherals.RGB.Fragment.Count, ReLogic.Peripherals.RGB.Fragment.GetCanvasPositionOfIndex(), Terraria.GameContent.RGB.NoiseHelper.GetDynamicNoise(), ReLogic.Peripherals.RGB.Fragment.GetGridPositionOfIndex(), Microsoft.Xna.Framework.Vector4.Lerp(), System.Math.Max(), and ReLogic.Peripherals.RGB.Fragment.SetColor().