-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
27 changed files
with
147 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using Microsoft.Xna.Framework; | ||
using System; | ||
|
||
namespace FSO.Common.Rendering | ||
{ | ||
public static class FinaleUtils | ||
{ | ||
private static Color[] FinaleColors = new Color[] | ||
{ | ||
new Color(2, 2, 2), | ||
new Color(2, 2, 2), | ||
Color.Lerp(new Color(0, 0, 0), new Color(50, 70, 122)*1.25f, 0.5f), | ||
new Color(70, 70, 70)*1.25f, | ||
new Color(217, 109, 50), //sunrise | ||
new Color(255, 255, 255), | ||
new Color(255, 255, 255), //peak | ||
new Color(255, 255, 255), //peak | ||
new Color(255, 255, 255), | ||
new Color(255, 255, 255), | ||
Color.Lerp(new Color(255, 255, 255), new Color(217, 109, 50), 0.33f), | ||
Color.Lerp(new Color(255, 255, 255), new Color(217, 109, 25), 0.66f), | ||
new Color(225, 64, 0), //sunset | ||
new Color(0, 0, 0) | ||
}; | ||
|
||
private static double DayOffset = 0.25; | ||
private static double DayDuration = 0.60; | ||
|
||
private static double TargetEnd = 1.04; | ||
|
||
public static double BiasSunTime(double modTime) | ||
{ | ||
if (IsFinale()) | ||
{ | ||
double dayMid = DayOffset + DayDuration / 2; | ||
double mainEnd = DayOffset + DayDuration; | ||
|
||
double rescaleDay = (TargetEnd - dayMid) / (mainEnd - dayMid); | ||
|
||
if (modTime > dayMid) | ||
{ | ||
modTime = dayMid + (modTime - dayMid) / rescaleDay; | ||
} | ||
} | ||
|
||
return modTime; | ||
} | ||
|
||
public static Vector3 BiasSunIntensity(Vector3 intensity, float time) | ||
{ | ||
if (IsFinale()) | ||
{ | ||
if (time > 0.70) | ||
{ | ||
intensity = Vector3.Lerp(new Vector3(0.6f), new Vector3(1, 0.2f, 0.1f), (time - 0.70f) / 0.25f); | ||
} | ||
else if (time > 0.5) | ||
{ | ||
intensity = Vector3.Lerp(intensity, new Vector3(0.6f), (time - 0.5f) / 0.2f); | ||
} | ||
|
||
if (time > 0.995) | ||
{ | ||
intensity *= (1f - time) * 200f; | ||
} | ||
} | ||
|
||
return intensity; | ||
} | ||
|
||
public static bool IsFinale() | ||
{ | ||
var time = DateTime.UtcNow; | ||
|
||
return time.Year == 2024 && time.Month == 12 && ((time.Day == 8 && time.Hour == 23) || (time.Day == 9 && time.Hour == 0)); | ||
} | ||
|
||
public static float GetDarkness() | ||
{ | ||
return IsFinale() ? 1.0f : 0.8f; | ||
} | ||
|
||
public static Color[] SwapFinaleColors(Color[] colors) | ||
{ | ||
return IsFinale() ? FinaleColors : colors; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+548 Bytes
(100%)
TSOClient/tso.content/Content/DX/Effects/GrassShaderiOS.xnb
Binary file not shown.
Binary file modified
BIN
+104 Bytes
(100%)
TSOClient/tso.content/Content/DX/Effects/ParticleShader.xnb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+155 Bytes
(100%)
TSOClient/tso.content/Content/OGL/Effects/2DWorldBatch.xnb
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+880 Bytes
(100%)
TSOClient/tso.content/Content/OGL/Effects/GrassShaderiOS.xnb
Binary file not shown.
Binary file modified
BIN
+320 Bytes
(100%)
TSOClient/tso.content/Content/OGL/Effects/ParticleShader.xnb
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+160 Bytes
(100%)
TSOClient/tso.content/Content/OGL/Effects/RCObjectiOS.xnb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters