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

◆ Update()

override void Terraria.GameContent.RGB.SkyShader.Update ( float elapsedTime)
inlinevirtual

Reimplemented from ReLogic.Peripherals.RGB.ChromaShader.

Definition at line 27 of file SkyShader.cs.

28 {
29 float num = Main.player[Main.myPlayer].position.Y / 16f;
30 _backgroundTransition = MathHelper.Clamp((num - (float)Main.worldSurface * 0.25f) / ((float)Main.worldSurface * 0.1f), 0f, 1f);
31 _processedSkyColor = _baseSkyColor * (Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f);
32 _processedCloudColor = Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f;
33 if (Main.dayTime)
34 {
35 float num2 = (float)(Main.time / 54000.0);
36 if (num2 < 0.25f)
37 {
38 _starVisibility = 1f - num2 / 0.25f;
39 }
40 else if (num2 > 0.75f)
41 {
42 _starVisibility = (num2 - 0.75f) / 0.25f;
43 }
44 else
45 {
46 _starVisibility = 0f;
47 }
48 }
49 else
50 {
51 _starVisibility = 1f;
52 }
54 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static byte Max(byte val1, byte val2)
Definition Math.cs:738

References Terraria.GameContent.RGB.SkyShader._backgroundTransition, Terraria.GameContent.RGB.SkyShader._baseSkyColor, Terraria.GameContent.RGB.SkyShader._processedCloudColor, Terraria.GameContent.RGB.SkyShader._processedSkyColor, Terraria.GameContent.RGB.SkyShader._starVisibility, Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.Main.ColorOfTheSkies, Terraria.Main.dayTime, System.Math.Max(), Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Main.time, and Terraria.Main.worldSurface.