DoGSky full revamp

- Entirely revamped DoGSky and cleaned up some of its older code
- - Moved DoGSky and DoGShaderData from CalamityMod/NPCs/DevourerofGods to CalamityMod/Skies
- - Added three new shaders which are used in the new sky, DoGDistortionWindsShader, DoGBackgroundFogShader and CircularOpacityShader
- - Removed MonolithDistortionScene and adjusted DoGBackgroundScene to account for both monoliths when activating background visuals
- - Added a new field to PrimitiveSettings which allows primitives to render with the same unscaled perspective matrices used for pixelating them. This was a necessary addition as the new DoGSky utilizes the primitive drawing system for a special visual effect and wasn't scaling correctly with the rest of the background due to the normal perspective matrices for primitives using the game's zoom setting to scale them accordingly. Backgrounds and any associated effects do not scale with zoom, for further context.
This commit is contained in:
fryzahh committed 2025-06-30 18:17:39 -04:00
1 parent 559173e816
commit 10fcee19a0
18 files changed
+870 -192

No files matched your search

+18
View File
@@ -225,6 +225,15 @@ namespace CalamityMod.Effects
// The underwater rays seen at the top of the Sunken Sea Mod Menu.
internal static Effect UnderwaterRaysShader;
// The blowing wind-like effect seen in the background during DoG's fight.
internal static Effect DoGDistortionWindsShader;
// The rolling fog clouds seen behind the Distortion Winds effect during DoG's fight.
internal static Effect DoGBackgroundFogShader;
// Allows a texture to control its opacity from the edges to the center in the shape of a circle.
internal static Effect CircularOpacityShader;
#endregion
public override void PostSetupContent()
@@ -447,6 +456,15 @@ namespace CalamityMod.Effects
UnderwaterRaysShader = LoadShader("UnderwaterRaysShader");
RegisterMiscShader(UnderwaterRaysShader, "UnderwaterRayPass", "UnderwaterRays");
DoGDistortionWindsShader = LoadShader("DoGDistortionWindsShader");
RegisterMiscShader(DoGDistortionWindsShader, "DistortionWindsPass", "DoGDistortionWinds");
DoGBackgroundFogShader = LoadShader("DoGBackgroundFogShader");
RegisterMiscShader(DoGBackgroundFogShader, "DoGFogPass", "DoGBackgroundFog");
CircularOpacityShader = LoadShader("CircularOpacityShader");
RegisterMiscShader(CircularOpacityShader, "CircularOpacityPass", "CircularOpacity");
#endregion
}
+28
View File
@@ -0,0 +1,28 @@
sampler baseTexture : register(s0);
float opacityCutoffValue;
float fadeoutPower;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Convert the regular coordinates to polar coordinates to get a circle shape.
float2 centeredCoords = coords - 0.5;
float polarAngle = atan2(centeredCoords.y, centeredCoords.x) / 6.283;
float distanceToCenter = length(centeredCoords);
float2 polarCoords = float2(polarAngle, distanceToCenter);
float4 color = tex2D(baseTexture, coords);
// Fade out from the edges of the texture to the middle depending on the cutoff value.
color.rgba *= pow(-polarCoords.y + opacityCutoffValue, fadeoutPower);
return color * sampleColor;
}
technique Technique1
{
pass CircularOpacityPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
sampler cloudsTexture : register(s0);
sampler distortionTexture : register(s1);
sampler erosionTexture : register(s2);
float time;
float overallOpacity;
float distortionStrength;
float mainNoiseTextureScale;
float distortionTextureScale;
float erosionTextureScale;
float erosionMin;
float gradientPrecision;
float2 pixelationFactor;
float2 worldOffset;
float3 darkerPixelColor;
float3 brighterPixelColor;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Pixelation.
coords = round(coords * pixelationFactor) / pixelationFactor;
// Stretch the coords out to better mimic a blowing wind effect.
coords *= float2(0.95, 1.05);
// Move with the player in the world.
coords += worldOffset;
// Calculate the distortion that'll be applied to our base noise coordinates.
float2 distortedCoords = coords + float2(time * -0.03, time * -0.01) * distortionTextureScale;
float distortion = tex2D(distortionTexture, distortedCoords).r * distortionStrength;
// Calculate the base noise colors.
float2 adjustedCoords = (coords + distortion) * mainNoiseTextureScale;
float4 scrollingNoise1 = tex2D(cloudsTexture, adjustedCoords + float2(time * -0.065, 0));
float4 scrollingNoise2 = tex2D(cloudsTexture, adjustedCoords + float2(time * -0.015, 0));
// Multiply the red values of the noise maps together to get the horizontal brightness of both noise maps.
float combinedBrightness = scrollingNoise1.r * scrollingNoise2.r;
// Lerp between the two colors based on the brightness of a pixel.
float3 colorFromBrightness = lerp(darkerPixelColor, brighterPixelColor, combinedBrightness);
// Erode the final output to break up the entire effect slightly.
float erosionColor = tex2D(erosionTexture, adjustedCoords + float2(time * -0.07, time * -0.02) * erosionTextureScale);
float erosionMax = erosionMin + 1;
float erosion = smoothstep(erosionMin, erosionMax, erosionColor.r);
float4 finalColor = (float4(colorFromBrightness, 1) * (scrollingNoise1 + scrollingNoise2));
finalColor *= erosion;
// Apply posterization.
finalColor = round(finalColor * gradientPrecision) / gradientPrecision;
return finalColor * overallOpacity;
}
technique Technique1
{
pass DoGFogPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+76
View File
@@ -0,0 +1,76 @@
sampler mainWindTexture : register(s0);
sampler windHighlightsTexture : register(s1);
sampler distortionTexture : register(s2);
sampler erosionTexture : register(s3);
float time;
float overallOpacity;
float distortionStrength;
float mainNoiseTextureScale;
float distortionTextureScale;
float erosionTextureScale;
float erosionMin;
float gradientPrecision;
float2 pixelationFactor;
float2 worldOffset;
float3 darkerPixelColor;
float3 brighterPixelColor;
float3 highlightsColor;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Pixelation.
coords = round(coords * pixelationFactor) / pixelationFactor;
// Stretch the coords out to better mimic a blowing wind effect.
coords *= float2(0.25, 1.25);
// Distort the coords in a sine wave so that they bend up and down.
coords.y += sin(coords.x * 10 + time) * 0.25;
// Move with the player in the world.
coords += worldOffset;
// Calculate the distortion that'll be applied to our base noise coordinates.
float2 distortedCoords = coords + float2(time * -0.18, 0) * distortionTextureScale;
float distortion = tex2D(distortionTexture, distortedCoords).r * distortionStrength;
// Calculate the base noise colors.
float2 adjustedCoords = (coords + distortion) * mainNoiseTextureScale;
float4 scrollingNoise1 = tex2D(mainWindTexture, adjustedCoords + float2(time * -0.092, 0));
float4 scrollingNoise2 = tex2D(mainWindTexture, adjustedCoords + float2(time * -0.031, 0));
// Multiply the red values of the noise maps together to get the horizontal brightness of both noise maps.
float combinedBrightness = scrollingNoise1.r * scrollingNoise2.r;
// Lerp between the two colors based on the brightness of a pixel.
float3 colorFromBrightness = lerp(darkerPixelColor, brighterPixelColor, combinedBrightness);
// Sample another texture to be used as highlights alongside the two noise textures.
float4 highlightNoise = tex2D(windHighlightsTexture, adjustedCoords + float2(time * -0.115, 0));
float4 windHighlights = highlightNoise * float4(highlightsColor, 1);
// Erode the final output to break up the entire effect slightly.
float erosionColor = tex2D(erosionTexture, adjustedCoords + float2(time * -0.087, 0) * erosionTextureScale);
float erosionMax = erosionMin + 1;
float erosion = smoothstep(erosionMin, erosionMax, erosionColor.r);
float4 finalColor = (float4(colorFromBrightness, 1) * (scrollingNoise1 + scrollingNoise2)) + (windHighlights * 2.25);
finalColor *= erosion;
// Apply posterization.
finalColor = round(finalColor * gradientPrecision) / gradientPrecision;
return finalColor * overallOpacity;
}
technique Technique1
{
pass DistortionWindsPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

+1 -1
View File
@@ -125,7 +125,7 @@ namespace CalamityMod.Graphics.Primitives
Matrix view;
Matrix projection;
if (MainSettings.Pixelate)
if (MainSettings.Pixelate || MainSettings.UseUnscaledMatrices)
CalcuatePixelatedPerspectiveMatrices(out view, out projection);
else
CalamityUtils.CalculatePerspectiveMatricies(out view, out projection);
+9 -1
View File
@@ -57,6 +57,12 @@ namespace CalamityMod.Graphics.Primitives
/// </summary>
public readonly bool Pixelate;
/// <summary>
/// Whether to use unscaled perspective matrices when rendering the primitives. Recommended only when the system is being used outside of its typical context
/// i.e. rendering primitives in the background via a CustomSky.
/// </summary>
public readonly bool UseUnscaledMatrices;
/// <summary>
/// The shader to apply when rendering.
/// </summary>
@@ -77,8 +83,9 @@ namespace CalamityMod.Graphics.Primitives
/// <param name="smoothen">Whether to use smoothening when generating the vertex positions from the provided ones. Recommended to be enabled.</param>
/// <param name="pixelate">Whether to pixelate the primitives. Recommended to be enabled if the effect was designed with this in mind.</param>
/// <param name="shader">The shader to apply when rendering the primitives.</param>
/// <param name="useUnscaledMatrices">Whether to use unscaled perspective matrices when rendering primitives. Recommended when using this system outside of its typical context; i.e. rendering primitives in the background via a CustomSky.</param>
/// <param name="initialVertexPositionsOverride">An optional override to force the trail to use the provided positions as the side positions of the initial vertex. They are the left and right positions respectively and should be in screen space.</param>
public PrimitiveSettings(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, VertexOffsetFunction offsetFunction = null, bool smoothen = true, bool pixelate = false, MiscShaderData shader = null, (Vector2, Vector2)? initialVertexPositionsOverride = null)
public PrimitiveSettings(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, VertexOffsetFunction offsetFunction = null, bool smoothen = true, bool pixelate = false, MiscShaderData shader = null, bool useUnscaledMatrices = false, (Vector2, Vector2)? initialVertexPositionsOverride = null)
{
WidthFunction = widthFunction;
ColorFunction = colorFunction;
@@ -86,6 +93,7 @@ namespace CalamityMod.Graphics.Primitives
Smoothen = smoothen;
Pixelate = pixelate;
Shader = shader;
UseUnscaledMatrices = useUnscaledMatrices;
InitialVertexPositionsOverride = initialVertexPositionsOverride;
}
}
+6 -6
View File
@@ -366,12 +366,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.TargetClosest();
Player player = Main.player[NPC.target];
if (DeathAnimationTimer < 435)
{
player.shimmerMonolithShader = true;
if (Main.shimmerDarken > 0.75f)
Main.shimmerDarken = 0.75f;
}
//if (DeathAnimationTimer < 435)
//{
// player.shimmerMonolithShader = true;
// if (Main.shimmerDarken > 0.75f)
// Main.shimmerDarken = 0.75f;
//}
// Variables
bool flyUpDuringLaserWalls = laserWallPhase == (int)LaserWallPhase.FireLaserWalls || (laserWallPhase == (int)LaserWallPhase.End && teleportTimer > 0);
bool flies = NPC.ai[3] == 0f || flyUpDuringLaserWalls;
-160
View File
@@ -1,160 +0,0 @@
using System.Linq;
using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
using Terraria.ModLoader;
using XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerI;
namespace CalamityMod.NPCs.DevourerofGods
{
public class DoGSky : CustomSky
{
private bool isActive = false;
private float intensity = 0f;
private int DoGIndex = -1;
private Color currentColor = Color.Black;
public static Color DoGSkyColor = Color.Black;
public override void Update(GameTime gameTime)
{
if (DoGIndex == -1)
{
UpdateDoGIndex();
if (DoGIndex == -1 && Main.LocalPlayer.Calamity().monolithDevourerBShader <= 0 && Main.LocalPlayer.Calamity().monolithDevourerPShader <= 0)
isActive = false;
}
if (isActive && intensity < 1f && Main.shimmerBrightenDelay <= 0)
{
intensity += 0.01f;
}
else if (!isActive && intensity > 0f)
{
intensity -= 0.01f;
}
//Main.NewText($"[c/{DoGSkyColor.Hex3()}:COLOR]");
}
public override Color OnTileColor(Color inColor)
{
return Color.Lerp(inColor, currentColor, intensity);
}
private bool UpdateDoGIndex()
{
int DoGType = ModContent.NPCType<DevourerofGodsHead>();
if (DoGIndex >= 0 && Main.npc[DoGIndex].active && Main.npc[DoGIndex].type == DoGType)
{
return true;
}
DoGIndex = -1;
foreach (NPC n in Main.ActiveNPCs)
{
if (n.type == DoGType)
{
DoGIndex = n.whoAmI;
break;
}
}
return DoGIndex != -1;
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (maxDepth >= 0 && minDepth < 0)
{
if (DoGIndex != -1)
{
var DoG = Main.npc[DoGIndex].ModNPC<DevourerofGodsHead>();
if (DoG == null)
{
DoGIndex = -1;
return;
}
if (DoG.NPC.active)
{
Color goalSkyColor = Color.Black;
if (DoG.isInAgressiveState)
goalSkyColor = Color.Fuchsia;
if (DoG.isInPassiveState)
goalSkyColor = Color.Cyan;
if (DoG.isInLaserWallState)
goalSkyColor = new Color(117, 21, 161);
if (DoG.isInPostWallState || DoG.postTeleportTimer > 0 || DoG.teleportTimer > 0 || (DoG.NPC.localAI[2] < 180 && DoG.NPC.localAI[2] > 60))
{
if (DoG.Phase2Started)
goalSkyColor = Color.Black;
else
goalSkyColor = new Color(117, 21, 161);
}
currentColor = Color.Lerp(currentColor, goalSkyColor, 0.1f);
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Lerp(currentColor,Color.Black, 0.5f) * intensity);
}
}
else
{
Color goalSkyColor = Color.Black;
if (Main.LocalPlayer.Calamity().monolithDevourerPShader > 0)
goalSkyColor = Color.Fuchsia;
if (Main.LocalPlayer.Calamity().monolithDevourerBShader > 0)
goalSkyColor = Color.Cyan;
currentColor = Color.Lerp(currentColor, goalSkyColor, 0.1f);
spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Lerp(currentColor, Color.Black, 0.5f) * intensity);
}
DoGSkyColor = currentColor;
}
}
public override float GetCloudAlpha()
{
return 0f;
}
public override void Activate(Vector2 position, params object[] args)
{
isActive = true;
}
public override void Deactivate(params object[] args)
{
isActive = false;
}
public override void Reset()
{
isActive = false;
}
public override bool IsActive()
{
return isActive || intensity > 0f;
}
}
public class DoGSkySunlightEnabler : ModSystem
{
public float FillProgress = 0;
public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor)
{
var cplayer = Main.LocalPlayer.Calamity();
if (Main.shimmerDarken > 0.4f && (cplayer.monolithDevourerBShader > 0 || cplayer.monolithDevourerPShader > 0 || Main.npc.Any(x => x.active && x.type == ModContent.NPCType<DevourerofGodsHead>())))
{
FillProgress += 0.05f;
} else
{
FillProgress = 0;
}
FillProgress = MathHelper.Clamp(FillProgress, 0, 1);
if (FillProgress > 0)
{
backgroundColor = Color.Lerp(backgroundColor, DoGSky.DoGSkyColor, FillProgress);
tileColor = Color.Lerp(tileColor, DoGSky.DoGSkyColor, FillProgress);
}
}
}
}
@@ -1,5 +1,7 @@
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.NPCs;
using CalamityMod.NPCs.DevourerofGods;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.ModLoader;
namespace CalamityMod.Systems
@@ -8,11 +10,21 @@ namespace CalamityMod.Systems
{
public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh;
public override bool IsSceneEffectActive(Player player) => NPC.AnyNPCs(ModContent.NPCType<DevourerofGodsHead>());
public override bool IsSceneEffectActive(Player player)
{
bool monolithIsActive = Main.LocalPlayer.Calamity().monolithDevourerBShader > 0 || Main.LocalPlayer.Calamity().monolithDevourerPShader > 0;
bool dogIsAlive = NPC.AnyNPCs(ModContent.NPCType<DevourerofGodsHead>());
return dogIsAlive || monolithIsActive;
}
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHead", isActive);
if (isActive)
SkyManager.Instance.Activate("CalamityMod:DevourerofGodsHead");
else
SkyManager.Instance.Deactivate("CalamityMod:DevourerofGodsHead");
}
}
}
@@ -1,17 +0,0 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Systems
{
public class MonolithDistortionScene : ModSceneEffect
{
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override bool IsSceneEffectActive(Player player) => Main.LocalPlayer.Calamity().monolithDevourerBShader > 0 || Main.LocalPlayer.Calamity().monolithDevourerPShader > 0;
public override void SpecialVisuals(Player player, bool isActive)
{
player.ManageSpecialBiomeVisuals("CalamityMod:DevourerofGodsHead", isActive);
}
}
}
@@ -1,10 +1,11 @@
using Microsoft.Xna.Framework;
using CalamityMod.NPCs.DevourerofGods;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.DevourerofGods
namespace CalamityMod.Skies
{
public class DoGScreenShaderData : ScreenShaderData
{
@@ -17,13 +18,13 @@ namespace CalamityMod.NPCs.DevourerofGods
private void UpdateDoGIndex()
{
int DoGType = ModContent.NPCType<DevourerofGodsHead>();
var DoGType = ModContent.NPCType<DevourerofGodsHead>();
if (DoGIndex >= 0 && Main.npc[DoGIndex].active && Main.npc[DoGIndex].type == DoGType)
{
return;
}
DoGIndex = -1;
foreach (NPC n in Main.ActiveNPCs)
foreach (var n in Main.ActiveNPCs)
{
if (n.type == DoGType)
{
@@ -54,6 +55,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
UseTargetPosition(Main.LocalPlayer.Center);
}
UseColor(DoGSky.DoGSkyColor);
base.Apply();
}
}
+643
View File
@@ -0,0 +1,643 @@
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Effects;
using CalamityMod.Events;
using CalamityMod.Graphics;
using CalamityMod.Graphics.Primitives;
using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace CalamityMod.Skies
{
public class DoGSky : CustomSky
{
public class RealityCrack
{
public Vector2 Position;
public float Depth;
public float Scale;
public float Rotation;
}
public class DistortionRiftArm
{
/// <summary>
/// The starting position of the arm.
/// </summary>
public Vector2 ArmStartingPosition;
/// <summary>
/// A list of the positions for each point which makes up the arm.
/// </summary>
public List<Vector2> ArmPoints;
/// <summary>
/// The depth of the rift arm.
/// </summary>
public float Depth;
/// <summary>
/// The maximum width of the rift arm.
/// </summary>
/// <remarks>
/// Note that this width tapers off till the end.
/// </remarks>
public float MaxWidth;
/// <summary>
/// The maximum amount of distance which can be between two points.
/// </summary>
public float MinDistanceBetweenPoints;
/// <summary>
/// The maximum amount of distance which can be between two points.
/// </summary>
public float MaxDistanceBetweenPoints;
/// <summary>
/// The minimum angle at which the points along the arm can be placed at randomly.
/// </summary>
/// <remarks>
/// Should ALWAYS be set as degrees.
/// </remarks>
public float MinPointAngularVariance;
/// <summary>
/// The minimum angle at which the points along the arm can be placed at randomly.
/// </summary>
/// <remarks>
/// Should ALWAYS be set as degrees.
/// </remarks>
public float MaxPointAngularVariance;
/// <summary>
/// The total amount of points that make up this rift arm.
/// </summary>
public int TotalPoints;
}
public bool Initialized;
public int DoGIndex;
private List<DistortionRiftArm> MainRiftCracks;
private List<DistortionRiftArm> OuterRiftCracks;
public static bool CanSkyBeActive { get; private set; }
public static float SkyIntensity { get; private set; }
public static Color DoGSkyColor { get; private set; }
public List<RealityCrack> RealityCracks { get; private set; } = [];
public List<DistortionRiftArm> DistortionRiftArms { get; private set; } = [];
public override void Update(GameTime gameTime)
{
DoGIndex = NPC.FindFirstNPC(ModContent.NPCType<DevourerofGodsHead>());
GetCorrectDoGColor();
// Initialize the reality cracks and distortion rift.
if (!Initialized)
{
for (int i = 0; i < 3; i++)
{
RealityCrack realityCrack = new RealityCrack()
{
Position = Main.LocalPlayer.Center,
Depth = 30f,
Scale = 2.75f,
Rotation = Main.rand.NextFloat(MathHelper.TwoPi)
};
RealityCracks.Add(realityCrack);
}
// Generate up to 30 arms for the rift.
// The first 14 are larger cracks to form the main hole at the impact point.
// The rest are longer, skinner cracks protruding outwards from it.
MainRiftCracks = [];
OuterRiftCracks = [];
for (int i = 0; i < 14; i++)
{
DistortionRiftArm distortionRiftArm = new DistortionRiftArm()
{
ArmStartingPosition = Main.LocalPlayer.Center,
Depth = 30f,
TotalPoints = 8,
MaxWidth = Main.rand.NextFloat(120f, 140f),
MinDistanceBetweenPoints = 40f,
MaxDistanceBetweenPoints = 80f,
MinPointAngularVariance = -6,
MaxPointAngularVariance = 6,
ArmPoints = [],
};
MainRiftCracks.Add(distortionRiftArm);
}
int outerCracksAmount = Main.rand.Next(12, 17);
for (int i = 0; i < outerCracksAmount; i++)
{
DistortionRiftArm distortionRiftArm = new DistortionRiftArm()
{
ArmStartingPosition = Main.LocalPlayer.Center,
Depth = 30f,
TotalPoints = Main.rand.Next(6, 10),
MaxWidth = Main.rand.NextFloat(4f, 7f),
MinDistanceBetweenPoints = 450f,
MaxDistanceBetweenPoints = 550f,
MinPointAngularVariance = Main.rand.Next(-10, -5),
MaxPointAngularVariance = Main.rand.Next(5, 10),
ArmPoints = [],
};
OuterRiftCracks.Add(distortionRiftArm);
}
Initialized = true;
}
// Generate the points for each arm and add them all to the global arm list.
// Main cracks.
for (int i = 0; i < MainRiftCracks.Count; i++)
{
float minDistance = MainRiftCracks[i].MinDistanceBetweenPoints * MainRiftCracks[i].Depth * 0.1f;
float maxDistance = MainRiftCracks[i].MaxDistanceBetweenPoints * MainRiftCracks[i].Depth * 0.1f;
float minAngularVariance = MainRiftCracks[i].MinPointAngularVariance;
float maxAngularVariance = MainRiftCracks[i].MaxPointAngularVariance;
float placementAngle = i * MathHelper.TwoPi / MainRiftCracks.Count;
if (MainRiftCracks[i].ArmPoints.Count <= 0)
MainRiftCracks[i].ArmPoints = GenerateDistortionRiftArmPoints(Main.LocalPlayer.Center, MainRiftCracks[i].TotalPoints, minDistance, maxDistance, minAngularVariance, maxAngularVariance, placementAngle);
if (!DistortionRiftArms.Contains(MainRiftCracks[i]))
DistortionRiftArms.Add(MainRiftCracks[i]);
}
// Outer cracks.
for (int i = 0; i < OuterRiftCracks.Count; i++)
{
float minDistance = OuterRiftCracks[i].MinDistanceBetweenPoints * OuterRiftCracks[i].Depth * 0.1f;
float maxDistance = OuterRiftCracks[i].MaxDistanceBetweenPoints * OuterRiftCracks[i].Depth * 0.1f;
float minAngularVariance = OuterRiftCracks[i].MinPointAngularVariance;
float maxAngularVariance = OuterRiftCracks[i].MaxPointAngularVariance;
float placementAngle = i * MathHelper.TwoPi / OuterRiftCracks.Count;
if (OuterRiftCracks[i].ArmPoints.Count <= 0)
OuterRiftCracks[i].ArmPoints = GenerateDistortionRiftArmPoints(Main.LocalPlayer.Center, OuterRiftCracks[i].TotalPoints, minDistance, maxDistance, minAngularVariance, maxAngularVariance, placementAngle);
if (!DistortionRiftArms.Contains(OuterRiftCracks[i]))
DistortionRiftArms.Add(OuterRiftCracks[i]);
}
if (CanSkyBeActive)
SkyIntensity = MathHelper.Clamp(SkyIntensity + 0.05f, 0f, 1f);
else
SkyIntensity = MathHelper.Clamp(SkyIntensity - 0.05f, 0f, 1f);
}
private List<Vector2> GenerateDistortionRiftArmPoints(Vector2 startingPosition, int totalPoints, float minDistanceBetweenPoints, float maxDistanceBetweenPoints, float minAngularVariance, float maxAngularVariance, float? optionalPointPlacementAngle = null)
{
// (Original code by Xyk; See TriactisHammerExplosion)
// -fryzahh
List<Vector2> points = [];
for (int j = 0; j < totalPoints; j++)
{
// First point should always be the starting position.
if (j == 0)
{
points.Add(startingPosition);
}
// Next point should be a random location around the starting position.
// If the placement angle has a value then rotate towards that with a very slight offset.
else if (j == 1)
{
float distanceFromLastPoint = Main.rand.NextFloat(minDistanceBetweenPoints, maxDistanceBetweenPoints);
Vector2 nextPointPosition = startingPosition + Main.rand.NextVector2Unit() * distanceFromLastPoint;
if (optionalPointPlacementAngle != null)
nextPointPosition = startingPosition + Vector2.UnitX.RotatedBy(optionalPointPlacementAngle.Value) * distanceFromLastPoint;
points.Add(nextPointPosition);
}
// All other points follow after the last one with the same slight offset to resemble cracks.
else
{
Vector2 previousPoint = points[j - 2];
float distanceFromLastPoint = Main.rand.NextFloat(minDistanceBetweenPoints, maxDistanceBetweenPoints);
if (j == totalPoints - 1)
distanceFromLastPoint = Main.rand.NextFloat(minDistanceBetweenPoints, maxDistanceBetweenPoints) * 0.5f;
Vector2 newPoint = points[j - 1] + (previousPoint.DirectionTo(points[j - 1]) * distanceFromLastPoint).RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(minAngularVariance, maxAngularVariance) * j * 0.5f));
points.Add(newPoint);
}
}
return points;
}
public override Color OnTileColor(Color inColor)
{
return Color.Lerp(inColor, DoGSkyColor, SkyIntensity);
}
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw the wind effect.
if (minDepth >= float.MinValue && maxDepth <= 5f)
DrawDistortionWinds(spriteBatch);
// Draw the rolling fog effect.
if (minDepth >= 3f && maxDepth <= 10f)
DrawRollingBackgroundFog(spriteBatch);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw the cracked glass textures.
if (minDepth >= 6f && maxDepth <= float.MaxValue)
DrawRealityCracks(spriteBatch);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw the rift to the Distortion over the cracked glass.
if (minDepth >= 6f && maxDepth <= float.MaxValue)
DrawDistortionRift(spriteBatch);
spriteBatch.End();
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
}
public void DrawRiftToRenderTarget()
{
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
Vector2 screenCenter = Main.screenPosition + (screenSize * 0.5f);
for (int i = 0; i < DistortionRiftArms.Count; i++)
{
Vector2 depthFactor = new(1f / DistortionRiftArms[i].Depth, 1.1f / DistortionRiftArms[i].Depth);
List<Vector2> parallaxedPoints = [];
for (int j = 0; j < DistortionRiftArms[i].ArmPoints.Count - 1; j++)
parallaxedPoints.Add((DistortionRiftArms[i].ArmPoints[j] - screenCenter) * depthFactor + screenCenter);
PrimitiveRenderer.RenderTrail(parallaxedPoints, new((completion) => MathHelper.Lerp(0f, DistortionRiftArms[i].MaxWidth, 1f - completion) * SkyIntensity, (_) => Color.White, null, false, useUnscaledMatrices: true), DistortionRiftArms[i].TotalPoints + 16);
}
}
private void GetCorrectDoGColor()
{
if (DoGIndex != -1)
{
var DoG = Main.npc[DoGIndex].ModNPC<DevourerofGodsHead>();
var goalSkyColor = Color.Black;
if (DoG.isInAgressiveState)
goalSkyColor = Color.Fuchsia;
if (DoG.isInPassiveState)
goalSkyColor = Color.Cyan;
if (DoG.isInLaserWallState)
goalSkyColor = new Color(117, 21, 161);
if (DoG.isInPostWallState || DoG.postTeleportTimer > 0 || DoG.teleportTimer > 0 || DoG.NPC.localAI[2] < 180 && DoG.NPC.localAI[2] > 60)
{
if (DoG.Phase2Started)
goalSkyColor = Color.Black;
else
goalSkyColor = new Color(117, 21, 161);
}
DoGSkyColor = Color.Lerp(DoGSkyColor, goalSkyColor, 0.1f);
}
else
{
var goalSkyColor = Color.Black;
if (Main.LocalPlayer.Calamity().monolithDevourerPShader > 0)
goalSkyColor = Color.Fuchsia;
if (Main.LocalPlayer.Calamity().monolithDevourerBShader > 0)
goalSkyColor = Color.Cyan;
DoGSkyColor = Color.Lerp(DoGSkyColor, goalSkyColor, 0.1f);
}
}
private void DrawDistortionWinds(SpriteBatch spriteBatch)
{
Effect shader = CalamityShaders.DoGDistortionWindsShader;
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
Asset<Texture2D> windsTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2");
Asset<Texture2D> highlightsTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/SharpNoise");
Asset<Texture2D> distortionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoise");
Asset<Texture2D> erosionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Pebbles");
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
shader.Parameters["overallOpacity"].SetValue(SkyIntensity * 0.55f);
shader.Parameters["distortionStrength"].SetValue(0.3f);
shader.Parameters["mainNoiseTextureScale"].SetValue(0.8f);
shader.Parameters["distortionTextureScale"].SetValue(0.6f);
shader.Parameters["erosionTextureScale"].SetValue(2f);
shader.Parameters["erosionMin"].SetValue(0.38f * SkyIntensity);
shader.Parameters["gradientPrecision"].SetValue(20f);
shader.Parameters["pixelationFactor"].SetValue(screenSize * 0.5f);
shader.Parameters["worldOffset"].SetValue(Main.screenPosition / windsTexture.Size() * 0.025f);
shader.Parameters["darkerPixelColor"].SetValue(Color.Lerp(Color.DarkGray, Color.Black, 0.8f).ToVector3());
shader.Parameters["brighterPixelColor"].SetValue(Color.Lerp(Color.DarkGray, Color.Black, 0.6f).ToVector3());
shader.Parameters["highlightsColor"].SetValue(DoGSkyColor.ToVector3());
Main.instance.GraphicsDevice.Textures[1] = highlightsTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[1] = SamplerState.PointWrap;
Main.instance.GraphicsDevice.Textures[2] = distortionTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[2] = SamplerState.LinearWrap;
Main.instance.GraphicsDevice.Textures[3] = erosionTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[3] = SamplerState.LinearWrap;
shader.CurrentTechnique.Passes[0].Apply();
spriteBatch.Draw(windsTexture.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White);
}
private void DrawRollingBackgroundFog(SpriteBatch spriteBatch)
{
Effect shader = CalamityShaders.DoGBackgroundFogShader;
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
Asset<Texture2D> cloudsTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/RealisticClouds");
Asset<Texture2D> erosionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly * 3f);
shader.Parameters["overallOpacity"].SetValue(SkyIntensity * 0.18f);
shader.Parameters["distortionStrength"].SetValue(0.12f);
shader.Parameters["mainNoiseTextureScale"].SetValue(0.6f);
shader.Parameters["distortionTextureScale"].SetValue(0.8f);
shader.Parameters["erosionTextureScale"].SetValue(0.26f);
shader.Parameters["erosionMin"].SetValue(0.06f * SkyIntensity);
shader.Parameters["gradientPrecision"].SetValue(20f);
shader.Parameters["pixelationFactor"].SetValue(screenSize * 0.5f);
shader.Parameters["worldOffset"].SetValue(Main.screenPosition / cloudsTexture.Size() * 0.005f);
shader.Parameters["darkerPixelColor"].SetValue(Color.Lerp(Color.Black, Color.DarkGray, 0.75f).ToVector3());
shader.Parameters["brighterPixelColor"].SetValue(Color.Lerp(Color.DarkGray, DoGSkyColor, 0.8f).ToVector3());
Main.instance.GraphicsDevice.Textures[1] = cloudsTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
Main.instance.GraphicsDevice.Textures[2] = erosionTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[2] = SamplerState.LinearWrap;
shader.CurrentTechnique.Passes[0].Apply();
spriteBatch.Draw(cloudsTexture.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White);
}
private void DrawRealityCracks(SpriteBatch spriteBatch)
{
Effect shader = CalamityShaders.CircularOpacityShader;
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
Vector2 screenCenter = Main.screenPosition + (screenSize * 0.5f);
Asset<Texture2D> cracksTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/CrackedGlass_Glowing");
shader.Parameters["opacityCutoffValue"].SetValue(0.75f * SkyIntensity);
shader.Parameters["fadeoutPower"].SetValue(1.75f);
shader.CurrentTechnique.Passes[0].Apply();
for (int i = 0; i < RealityCracks.Count; i++)
{
Vector2 depthFactor = new(1f / RealityCracks[i].Depth, 1.1f / RealityCracks[i].Depth);
Vector2 drawPosition = (RealityCracks[i].Position - screenCenter) * depthFactor + screenCenter - Main.screenPosition;
spriteBatch.Draw(cracksTexture.Value, drawPosition, new Rectangle(0, 0, cracksTexture.Width(), cracksTexture.Height()), Color.White, RealityCracks[i].Rotation, cracksTexture.Size() * 0.5f, RealityCracks[i].Scale * 0.5f, 0, 0f);
}
}
private void DrawDistortionRift(SpriteBatch spriteBatch)
{
// Impose the distortion rift contents onto the primitives via shader.
var metaballShader = CalamityShaders.MetaballEdgeShader;
Texture2D distortionRiftContents = DoGWorldVisualChangesManager.DistortionRiftBackgroundContentsTarget;
Texture2D distortionRift = DoGWorldVisualChangesManager.DistortionRiftPrimitivesTarget;
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
metaballShader.Parameters["layerSize"]?.SetValue(distortionRiftContents.Size());
metaballShader.Parameters["screenSize"]?.SetValue(screenSize);
metaballShader.Parameters["layerOffset"]?.SetValue(Vector2.Zero);
metaballShader.Parameters["edgeColor"]?.SetValue(Color.Lerp(DoGSkyColor, Color.Black, 0.85f).ToVector4());
Main.instance.GraphicsDevice.Textures[1] = distortionRiftContents;
Main.instance.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
metaballShader.CurrentTechnique.Passes[0].Apply();
spriteBatch.Draw(distortionRift, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White);
}
public override float GetCloudAlpha()
{
return 1f;
}
public override void Activate(Vector2 position, params object[] args)
{
CanSkyBeActive = true;
}
public override void Deactivate(params object[] args)
{
CanSkyBeActive = false;
RealityCracks.Clear();
DistortionRiftArms.Clear();
Initialized = false;
}
public override void Reset()
{
CanSkyBeActive = false;
RealityCracks.Clear();
DistortionRiftArms.Clear();
Initialized = false;
}
public override bool IsActive()
{
return CanSkyBeActive || SkyIntensity > 0f;
}
}
public class DoGWorldVisualChangesManager : ModSystem
{
public float FillProgress = 0;
public static ManagedRenderTarget DistortionRiftBackgroundContentsTarget { get; private set; }
public static ManagedRenderTarget DistortionRiftPrimitivesTarget { get; private set; }
public override void OnModLoad()
{
if (!Main.dedServ)
On_Main.DrawSunAndMoon += DiscardCelestialObjects;
}
public override void PostSetupContent()
{
if (Main.dedServ)
return;
Main.QueueMainThreadAction(() =>
{
DistortionRiftBackgroundContentsTarget = new(true, ManagedRenderTarget.CreateScreenSizedTarget);
DistortionRiftPrimitivesTarget = new(true, ManagedRenderTarget.CreateScreenSizedTarget);
});
RenderTargetManager.RenderTargetUpdateLoopEvent += PrepareTargets;
}
public override void OnModUnload()
{
if (Main.dedServ)
return;
On_Main.DrawSunAndMoon -= DiscardCelestialObjects;
RenderTargetManager.RenderTargetUpdateLoopEvent -= PrepareTargets;
}
public override void ModifySunLightColor(ref Color tileColor, ref Color backgroundColor)
{
var cplayer = Main.LocalPlayer.Calamity();
if (cplayer.monolithDevourerBShader > 0 || cplayer.monolithDevourerPShader > 0 || NPC.AnyNPCs(ModContent.NPCType<DevourerofGodsHead>()))
FillProgress += 0.05f;
else
FillProgress -= 0.05f;
// Darken the lighting color of both the background and foreground.
FillProgress = MathHelper.Clamp(FillProgress, 0, 1);
if (FillProgress > 0)
{
Color colorToUse = DoGSky.DoGSkyColor;
backgroundColor.R = (byte)MathHelper.Lerp(Main.ColorOfTheSkies.R, Main.ColorOfTheSkies.R * 0.075f, FillProgress);
backgroundColor.G = (byte)MathHelper.Lerp(Main.ColorOfTheSkies.G, Main.ColorOfTheSkies.G * 0.075f, FillProgress);
backgroundColor.B = (byte)MathHelper.Lerp(Main.ColorOfTheSkies.B, Main.ColorOfTheSkies.B * 0.075f, FillProgress);
backgroundColor = new(backgroundColor.ToVector3() + colorToUse.ToVector3() * 0.025f * FillProgress);
tileColor.R = (byte)MathHelper.Lerp(Main.ColorOfTheSkies.R, 100f, FillProgress);
tileColor.G = (byte)MathHelper.Lerp(Main.ColorOfTheSkies.G, 100f, FillProgress);
tileColor.B = (byte)MathHelper.Lerp(Main.ColorOfTheSkies.B, 100f, FillProgress);
tileColor = new(tileColor.ToVector3() + colorToUse.ToVector3() * 0.075f * FillProgress);
}
}
private void DiscardCelestialObjects(On_Main.orig_DrawSunAndMoon orig, Main self, Main.SceneArea sceneArea, Color moonColor, Color sunColor, float tempMushroomInfluence)
{
if (DoGSky.SkyIntensity > 0f)
tempMushroomInfluence = DoGSky.SkyIntensity;
orig(self, sceneArea, moonColor, sunColor, tempMushroomInfluence);
}
private void PrepareTargets()
{
DistortionRiftBackgroundContentsTarget.SwapTo();
// Draw the background which'll be displayed inside the rift onto a render target.
DrawDistortionRiftBackground();
DistortionRiftPrimitivesTarget.SwapTo();
// Draw the primitives which compromise the rift to another render target.
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
if (SkyManager.Instance["CalamityMod:DevourerofGodsHead"].IsActive())
(SkyManager.Instance["CalamityMod:DevourerofGodsHead"] as DoGSky).DrawRiftToRenderTarget();
Main.spriteBatch.End();
Main.instance.GraphicsDevice.SetRenderTarget(null);
}
private static void DrawDistortionRiftBackground()
{
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw a black tile behind everything since the shader used to generate the clouds will appear transparent with dark colors.
Main.spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black);
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw the layer of rolling clouds in the background.
DrawDistortionBackgroundClouds();
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw the small stars that twinkle and fade out quickly.
DrawDistortionBackgroundStars();
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix);
// Draw the purple lightning bolts
DrawDistortionBackgroundLighting();
Main.spriteBatch.End();
}
private static void DrawDistortionBackgroundClouds()
{
Effect rollingCloudsShader = CalamityShaders.DoGBackgroundFogShader;
Vector2 screenSize = new(Main.screenWidth, Main.screenHeight);
Asset<Texture2D> cloudsTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/RealisticClouds");
Asset<Texture2D> erosionTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
rollingCloudsShader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
rollingCloudsShader.Parameters["overallOpacity"].SetValue(0.75f);
rollingCloudsShader.Parameters["distortionStrength"].SetValue(0.12f);
rollingCloudsShader.Parameters["mainNoiseTextureScale"].SetValue(2f);
rollingCloudsShader.Parameters["distortionTextureScale"].SetValue(0.8f);
rollingCloudsShader.Parameters["erosionTextureScale"].SetValue(0.26f);
rollingCloudsShader.Parameters["erosionMin"].SetValue(0.06f);
rollingCloudsShader.Parameters["gradientPrecision"].SetValue(20f);
rollingCloudsShader.Parameters["pixelationFactor"].SetValue(screenSize * 0.5f);
rollingCloudsShader.Parameters["worldOffset"].SetValue(Main.screenPosition / cloudsTexture.Size() * 0.001f);
rollingCloudsShader.Parameters["darkerPixelColor"].SetValue(Color.Lerp(Color.Black, Color.DarkGray, 0.25f).ToVector3());
rollingCloudsShader.Parameters["brighterPixelColor"].SetValue(Color.Lerp(Color.Black, DoGSky.DoGSkyColor, 0.4f).ToVector3());
Main.instance.GraphicsDevice.Textures[1] = cloudsTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap;
Main.instance.GraphicsDevice.Textures[2] = erosionTexture.Value;
Main.instance.GraphicsDevice.SamplerStates[2] = SamplerState.LinearWrap;
rollingCloudsShader.CurrentTechnique.Passes[0].Apply();
Main.spriteBatch.Draw(cloudsTexture.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White);
}
private static void DrawDistortionBackgroundLighting()
{
// TODO
}
private static void DrawDistortionBackgroundStars()
{
// TODO
}
}
}
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Systems
{
public override void Load()
{
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh);
Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseOpacity(0.15f), EffectPriority.VeryHigh);
SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky();
Filters.Scene["CalamityMod:CalamitasRun3"] = new Filter(new CalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.6f), EffectPriority.VeryHigh);