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

◆ ProcessHighDetail()

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

Definition at line 28 of file DrowningShader.cs.

29 {
30 float num = _breath * 1.2f - 0.1f;
31 for (int i = 0; i < fragment.Count; i++)
32 {
33 Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(i);
34 Vector4 vector = Vector4.Zero;
35 if (canvasPositionOfIndex.Y > num)
36 {
37 vector = new Vector4(0f, 0f, 1f, MathHelper.Clamp((canvasPositionOfIndex.Y - num) * 5f, 0f, 1f));
38 }
39 fragment.SetColor(i, vector);
40 }
41 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
void SetColor(int index, Vector4 color)
Definition Fragment.cs:97
Vector2 GetCanvasPositionOfIndex(int index)
Definition Fragment.cs:75

References Terraria.GameContent.RGB.DrowningShader._breath, Microsoft.Xna.Framework.MathHelper.Clamp(), ReLogic.Peripherals.RGB.Fragment.Count, ReLogic.Peripherals.RGB.Fragment.GetCanvasPositionOfIndex(), ReLogic.Peripherals.RGB.Fragment.SetColor(), Microsoft.Xna.Framework.Vector2.Y, and Microsoft.Xna.Framework.Vector4.Zero.