Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LightDiscDrawer.cs
Go to the documentation of this file.
4
5namespace Terraria.Graphics;
6
7[StructLayout(LayoutKind.Sequential, Size = 1)]
8public struct LightDiscDrawer
9{
10 private static VertexStrip _vertexStrip = new VertexStrip();
11
12 public void Draw(Projectile proj)
13 {
14 MiscShaderData miscShaderData = GameShaders.Misc["LightDisc"];
15 miscShaderData.UseSaturation(-2.8f);
16 miscShaderData.UseOpacity(2f);
17 miscShaderData.Apply();
18 _vertexStrip.PrepareStripWithProceduralPadding(proj.oldPos, proj.oldRot, StripColors, StripWidth, -Main.screenPosition + proj.Size / 2f);
19 _vertexStrip.DrawTrail();
20 Main.pixelShader.CurrentTechnique.Passes[0].Apply();
21 }
22
23 private Color StripColors(float progressOnStrip)
24 {
25 float num = 1f - progressOnStrip;
26 Color result = new Color(48, 63, 150) * (num * num * num * num) * 0.5f;
27 result.A = 0;
28 return result;
29 }
30
31 private float StripWidth(float progressOnStrip)
32 {
33 return 16f;
34 }
35}
Vector2 Size
Definition Entity.cs:151
static Dictionary< string, MiscShaderData > Misc
virtual void Apply(DrawData? drawData=null)
MiscShaderData UseSaturation(float saturation)
MiscShaderData UseOpacity(float alpha)
static Effect pixelShader
Definition Main.cs:2764
static Vector2 screenPosition
Definition Main.cs:1715
Color StripColors(float progressOnStrip)
float StripWidth(float progressOnStrip)