Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EmpressBladeDrawer.cs
Go to the documentation of this file.
3
4namespace Terraria.Graphics;
5
6public struct EmpressBladeDrawer
7{
8 public const int TotalIllusions = 1;
9
10 public const int FramesPerImportantTrail = 60;
11
12 private static VertexStrip _vertexStrip = new VertexStrip();
13
15
17
18 public void Draw(Projectile proj)
19 {
20 _ = proj.ai[1];
21 MiscShaderData miscShaderData = GameShaders.Misc["EmpressBlade"];
22 int num = 1;
23 int num2 = 0;
24 int num3 = 0;
25 float w = 0.6f;
26 miscShaderData.UseShaderSpecificData(new Vector4(num, num2, num3, w));
27 miscShaderData.Apply();
28 _vertexStrip.PrepareStrip(proj.oldPos, proj.oldRot, StripColors, StripWidth, -Main.screenPosition + proj.Size / 2f, proj.oldPos.Length, includeBacksides: true);
29 _vertexStrip.DrawTrail();
30 Main.pixelShader.CurrentTechnique.Passes[0].Apply();
31 }
32
33 private Color StripColors(float progressOnStrip)
34 {
35 Color result = Color.Lerp(ColorStart, ColorEnd, Utils.GetLerpValue(0f, 0.7f, progressOnStrip, clamped: true)) * (1f - Utils.GetLerpValue(0f, 0.98f, progressOnStrip, clamped: true));
36 result.A /= 2;
37 return result;
38 }
39
40 private float StripWidth(float progressOnStrip)
41 {
42 return 36f;
43 }
44}
Vector2 Size
Definition Entity.cs:151
static Dictionary< string, MiscShaderData > Misc
virtual void Apply(DrawData? drawData=null)
MiscShaderData UseShaderSpecificData(Vector4 specificData)
static Effect pixelShader
Definition Main.cs:2764
static Vector2 screenPosition
Definition Main.cs:1715
static float GetLerpValue(float from, float to, float t, bool clamped=false)
Definition Utils.cs:203
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491
float StripWidth(float progressOnStrip)
Color StripColors(float progressOnStrip)