Added a visual border + inferno for providence
This commit is contained in:
1 parent
2114a82092
commit
7597ecdb80
12 files changed
+181
-144
No files matched your search
@@ -230,6 +230,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int spiritOriginConvertedCrit = 0;
|
||||
public int RustyMedallionCooldown = 0;
|
||||
public float SulphWaterPoisoningLevel;
|
||||
public float holyInfernoFadeIntensity;
|
||||
public NPC unstableSelectedTarget;
|
||||
public int zapActivity = 0;
|
||||
public bool ragePulse = false;
|
||||
@@ -2230,6 +2231,7 @@ namespace CalamityMod.CalPlayer
|
||||
hideOfDeusTimer = 0;
|
||||
RustyMedallionCooldown = 0;
|
||||
SulphWaterPoisoningLevel = 0f;
|
||||
holyInfernoFadeIntensity = 0f;
|
||||
spiritOriginConvertedCrit = 0;
|
||||
rage = 0f;
|
||||
adrenaline = 0f;
|
||||
|
||||
@@ -937,16 +937,24 @@ namespace CalamityMod.CalPlayer
|
||||
if (!Main.rand.NextBool(3))
|
||||
continue;
|
||||
|
||||
Dust holyCinder = Dust.NewDustDirect(Player.position, Player.width, Player.head, (int)CalamityDusts.ProfanedFire);
|
||||
//Using player.head causes the dust to appear in a line below the player, which is not the intended effect. (Remove this comment in pr, only serves to inform)
|
||||
Dust holyCinder = Dust.NewDustDirect(Player.position, Player.width, Player.height, (int)CalamityDusts.ProfanedFire);
|
||||
holyCinder.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
|
||||
holyCinder.velocity.Y -= Main.rand.NextFloat(1f, 3f);
|
||||
holyCinder.scale = Main.rand.NextFloat(1.15f, 1.45f);
|
||||
holyCinder.noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
ProvidenceBurnEffectDrawer.Update();
|
||||
|
||||
if (hInferno && holyInfernoFadeIntensity < 1f)
|
||||
{
|
||||
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity + 0.015f, 0f, 1f);
|
||||
}
|
||||
else if (!hInferno && holyInfernoFadeIntensity > 0f)
|
||||
{
|
||||
holyInfernoFadeIntensity = MathHelper.Clamp(holyInfernoFadeIntensity - 0.01f, 0f, 1f);
|
||||
}
|
||||
// Transformer immunity to Electrified
|
||||
if (transformer)
|
||||
Player.buffImmune[BuffID.Electrified] = true;
|
||||
|
||||
@@ -179,12 +179,13 @@ namespace CalamityMod.Effects
|
||||
#endregion
|
||||
|
||||
//
|
||||
// All below shaders were added by Amber
|
||||
// Authorship goes to Toasty
|
||||
// All below shaders were added or created by Amber
|
||||
// Authorship for the PrimitiveClearShader goes to Toasty
|
||||
//
|
||||
|
||||
#region Amber's Shaders
|
||||
internal static Effect PrimitiveClearShader;
|
||||
internal static Effect HolyInfernoShader;
|
||||
#endregion
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
@@ -390,6 +391,10 @@ namespace CalamityMod.Effects
|
||||
#region Loading Amber's Shaders
|
||||
PrimitiveClearShader = LoadShader("PrimitiveClearShader");
|
||||
RegisterScreenShader(PrimitiveClearShader, "AutoloadPass", "PrimitiveClearShader");
|
||||
|
||||
HolyInfernoShader = LoadShader("HolyInfernoShader");
|
||||
RegisterMiscShader(HolyInfernoShader, "InfernoPass", "HolyInfernoShader");
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
sampler diagonalNoise : register(s1);
|
||||
sampler upwardNoise : register(s2);
|
||||
sampler upwardPerlinTex : register(s3);
|
||||
|
||||
float colorMult;
|
||||
float time;
|
||||
float radius;
|
||||
float maxOpacity;
|
||||
float burnIntensity;
|
||||
|
||||
float2 screenPosition;
|
||||
float2 screenSize;
|
||||
float2 anchorPoint;
|
||||
float2 playerPosition;
|
||||
|
||||
float InverseLerp(float a, float b, float t)
|
||||
{
|
||||
return saturate((t - a) / (b - a));
|
||||
}
|
||||
|
||||
float3 firePalette(float noise)
|
||||
{
|
||||
// Temperature range (in Kelvin).
|
||||
float temperature = 1500. + 1500. * noise;
|
||||
|
||||
float3 orange = float3(0.81, 0.45, 0.23) * colorMult;
|
||||
float3 golden = float3(1., 0.75, 0.29) * colorMult;
|
||||
float3 lightYellow = float3(1., 1., 0.95) * colorMult;
|
||||
float3 fireColor;
|
||||
if (noise < 0.5)
|
||||
fireColor = lerp(orange, golden, noise * 2.);
|
||||
else
|
||||
fireColor = lerp(golden, lightYellow, (noise - 0.5) * 2.);
|
||||
|
||||
fireColor = pow(fireColor, float3(5, 5, 5)) * (exp(1.43876719683e5 / (temperature * fireColor)) - 1.);
|
||||
|
||||
// Exposure level. Set to "50." For "70," change the "5" to a "7," etc.
|
||||
return 1. - exp(-1.3e8 / fireColor);
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 uv : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float2 worldUV = screenPosition + screenSize * uv;
|
||||
float2 provUV = anchorPoint / screenSize;
|
||||
float worldDistance = distance(worldUV, anchorPoint);
|
||||
float adjustedTime = time * 0.1;
|
||||
|
||||
// Pixelate the uvs
|
||||
float2 pixelatedUV = worldUV / screenSize;
|
||||
pixelatedUV.x -= worldUV.x % (1 / screenSize.x);
|
||||
pixelatedUV.y -= worldUV.y % (1 / (screenSize.y / 2) * 2);
|
||||
|
||||
// Sample the noise textures
|
||||
float noiseMesh1 = tex2D(upwardNoise, frac(pixelatedUV * 0.58 + float2(0, time * 0.25))).g;
|
||||
float noiseMesh2 = tex2D(upwardPerlinTex, frac(pixelatedUV * 1.57 + float2(0, time * 0.35))).g;
|
||||
float noiseMesh3 = tex2D(diagonalNoise, frac(pixelatedUV * 1.46 + float2(adjustedTime * 0.56, adjustedTime * 1.2))).g;
|
||||
float noiseMesh4 = tex2D(diagonalNoise, frac(pixelatedUV * 1.57 + float2(adjustedTime * -0.56, adjustedTime * 1.2))).g;
|
||||
float textureMesh = noiseMesh1 * 0.125 + noiseMesh2 * 0.2 + noiseMesh3 * 0.35 + noiseMesh4 * 0.35;
|
||||
|
||||
// Get the distance to the pixel from the player.
|
||||
float distToPlayer = distance(playerPosition, worldUV);
|
||||
// And get the correct opacity based on it.
|
||||
float opacity = burnIntensity;
|
||||
// Fade in quickly as the player approaches the pixels
|
||||
opacity += InverseLerp(800, 500, distToPlayer);
|
||||
|
||||
// Define the border and mix the inferno for a smooth transition
|
||||
bool border = worldDistance < radius && opacity > 0;
|
||||
float colorMult = 1;
|
||||
if (border)
|
||||
colorMult = InverseLerp(radius * 0.94, radius, worldDistance);
|
||||
opacity = clamp(opacity, 0, maxOpacity);
|
||||
// If the color multi has not been changed (not border pixel) and opacity is 0 OR it's within
|
||||
if (colorMult == 1 && (opacity == 0 || worldDistance < radius))
|
||||
return sampleColor;
|
||||
|
||||
return float4(firePalette(textureMesh), 1) * colorMult * opacity;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass InfernoPass
|
||||
{
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 285 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 325 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 327 KiB |
@@ -35,7 +35,7 @@ namespace CalamityMod.Graphics.Drawers
|
||||
On_Main.DrawNPCs += DrawNPCDrawers;
|
||||
On_Main.DrawProjectiles += DrawProjectileDrawers;
|
||||
On_Main.DrawPlayers_AfterProjectiles += DrawPlayerDrawers;
|
||||
On_Main.DoDraw_WallsTilesNPCs += DrawBeforeTileDrawers;
|
||||
On_Main.DrawBackgroundBlackFill += DrawBeforeTileDrawers;
|
||||
On_Main.DrawInfernoRings += DrawAfterEverythingDrawers;
|
||||
|
||||
var drawerType = typeof(BaseDrawer);
|
||||
@@ -64,7 +64,7 @@ namespace CalamityMod.Graphics.Drawers
|
||||
On_Main.DrawNPCs -= DrawNPCDrawers;
|
||||
On_Main.DrawProjectiles -= DrawProjectileDrawers;
|
||||
On_Main.DrawPlayers_AfterProjectiles -= DrawPlayerDrawers;
|
||||
On_Main.DoDraw_WallsTilesNPCs -= DrawBeforeTileDrawers;
|
||||
On_Main.DrawBackgroundBlackFill -= DrawBeforeTileDrawers;
|
||||
On_Main.DrawInfernoRings -= DrawAfterEverythingDrawers;
|
||||
|
||||
foreach (var drawer in Drawers)
|
||||
@@ -143,7 +143,7 @@ namespace CalamityMod.Graphics.Drawers
|
||||
Main.spriteBatch.End();
|
||||
}
|
||||
|
||||
private void DrawBeforeTileDrawers(On_Main.orig_DoDraw_WallsTilesNPCs orig, Main self)
|
||||
private void DrawBeforeTileDrawers(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
|
||||
{
|
||||
var drawers = Drawers.Where(drawer => drawer.ShouldDraw && drawer.Layer is DrawerLayer.BeforeTiles);
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
using Rectangle = Microsoft.Xna.Framework.Rectangle;
|
||||
|
||||
namespace CalamityMod.Graphics.Drawers
|
||||
{
|
||||
public class HolyInfernoDrawer : BaseDrawer
|
||||
{
|
||||
#region Fields/Properties
|
||||
|
||||
public override DrawerLayer Layer => DrawerLayer.BeforeTiles;
|
||||
|
||||
public Providence Provi => (Main.npc[CalamityGlobalNPC.holyBoss].ModNPC as Providence);
|
||||
|
||||
//Should only draw if not in the main menu, provi is active and the boolean for drawing the border is true.
|
||||
public override bool ShouldDraw => !Main.gameMenu && CalamityGlobalNPC.holyBoss != -1 &&
|
||||
Main.npc[CalamityGlobalNPC.holyBoss].active && (Main.npc[CalamityGlobalNPC.holyBoss].ModNPC as Providence).shouldDrawInfernoBorder;
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
public override void DrawToTarget(SpriteBatch spriteBatch)
|
||||
{
|
||||
var npc = Main.npc[CalamityGlobalNPC.holyBoss];
|
||||
var provi = npc.ModNPC as Providence;
|
||||
var borderStartEnd = provi.borderStartEnd;
|
||||
if (borderStartEnd.Key > 0f && npc.HasValidTarget)
|
||||
{
|
||||
var target = Main.player[Main.myPlayer];
|
||||
var holyInfernoIntensity = target.Calamity().holyInfernoFadeIntensity;
|
||||
|
||||
//Begin drawing the inferno
|
||||
var blackTile = TextureAssets.MagicPixel;
|
||||
var diagonalNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
|
||||
var upwardPerlinNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Perlin");
|
||||
var upwardNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoise");
|
||||
|
||||
var shader = GameShaders.Misc["CalamityMod:HolyInfernoShader"].Shader;
|
||||
shader.Parameters["colorMult"].SetValue(7.35f); //I want you to know it took considerable restraint to deliberately misspell colour.
|
||||
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
|
||||
shader.Parameters["radius"].SetValue(borderStartEnd.Value);
|
||||
shader.Parameters["anchorPoint"].SetValue(npc.Center);
|
||||
shader.Parameters["screenPosition"].SetValue(Main.screenPosition);
|
||||
shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2());
|
||||
shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity);
|
||||
shader.Parameters["playerPosition"].SetValue(target.Center);
|
||||
shader.Parameters["maxOpacity"].SetValue(1f);
|
||||
|
||||
spriteBatch.GraphicsDevice.Textures[1] = diagonalNoise.Value;
|
||||
spriteBatch.GraphicsDevice.Textures[2] = upwardNoise.Value;
|
||||
spriteBatch.GraphicsDevice.Textures[3] = upwardPerlinNoise.Value;
|
||||
|
||||
//Manual end begin for the sampler state
|
||||
spriteBatch.End();
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, shader, Main.GameViewMatrix.TransformationMatrix);
|
||||
Rectangle rekt = new(Main.screenWidth / 2, Main.screenHeight / 2, Main.screenWidth, Main.screenHeight);
|
||||
spriteBatch.Draw(blackTile.Value, rekt, null, default, 0f, blackTile.Value.Size() * 0.5f, 0, 0f);
|
||||
//Inferno drawing complete
|
||||
spriteBatch.ExitShaderRegion();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -297,7 +297,7 @@ namespace CalamityMod.ILEditing
|
||||
self.velocity = Collision.AdvancedTileCollision(TileID.Sets.ForAdvancedCollision.ForSandshark, cPosition, self.velocity, cWidth, cHeight, fall, fall, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (self.active && self.Calamity().ShouldFallThroughPlatforms)
|
||||
fall = true;
|
||||
|
||||
|
||||
@@ -31,23 +31,16 @@ using ReLogic.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.Effects;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Bestiary;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.UI;
|
||||
using static CalamityMod.PrimitiveTrail;
|
||||
using Filters = Terraria.Graphics.Effects.Filters;
|
||||
using CalamityMod.NPCs.TownNPCs;
|
||||
|
||||
namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
@@ -96,6 +89,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
private int healTimer = 0;
|
||||
internal bool challenge = Main.expertMode; //Used to determine if Profaned Soul Crystal should drop, couldn't figure out mp mems always dropping it so challenge is singleplayer only.
|
||||
internal bool hasTakenDaytimeDamage = false;
|
||||
public bool shouldDrawInfernoBorder = true; //This is only here for other mods to disable it if they don't want it drawing.
|
||||
public bool Dying = false;
|
||||
public int DeathAnimationTimer;
|
||||
public KeyValuePair<float, float> borderStartEnd = new (0f, 0f);
|
||||
@@ -133,7 +127,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
};
|
||||
value.Position.Y += 6f;
|
||||
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
|
||||
NPCID.Sets.MustAlwaysDraw[Type] = true; //this is REQUIRED for the border to draw due to it's larger distance.
|
||||
NPCID.Sets.MPAllowedEnemies[Type] = true;
|
||||
}
|
||||
|
||||
@@ -199,6 +192,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
writer.Write(DeathAnimationTimer);
|
||||
writer.Write(borderStartEnd.Key);
|
||||
writer.Write(borderStartEnd.Value);
|
||||
writer.Write(shouldDrawInfernoBorder);
|
||||
for (int i = 0; i < 4; i++)
|
||||
writer.Write(NPC.Calamity().newAI[i]);
|
||||
}
|
||||
@@ -225,6 +219,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
Dying = reader.ReadBoolean();
|
||||
DeathAnimationTimer = reader.ReadInt32();
|
||||
borderStartEnd = new (reader.ReadSingle(), reader.ReadSingle());
|
||||
shouldDrawInfernoBorder = reader.ReadBoolean();
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
NPC.Calamity().newAI[i] = reader.ReadSingle();
|
||||
@@ -800,7 +795,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
acceleration *= 1.2f;
|
||||
}
|
||||
|
||||
if (!targetDead && false)
|
||||
if (!targetDead)
|
||||
{
|
||||
NPC.velocity.X += flightPath * acceleration;
|
||||
if (NPC.velocity.X > velocity)
|
||||
@@ -1730,8 +1725,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
NPC.velocity = Vector2.Zero;
|
||||
}
|
||||
|
||||
public void DoDeathAnimation()
|
||||
@@ -2055,12 +2048,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
//This offscreen culling is due to providence always drawing for the purposes of the holy inferno border.
|
||||
//This ensures that there is NO offscreen drawing occuring and there is no performance impact as a result.
|
||||
Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone;
|
||||
Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true;
|
||||
Main.instance.GraphicsDevice.ScissorRectangle = new Rectangle(0, 0, Main.screenWidth, Main.screenHeight); //offscreen culling
|
||||
|
||||
void drawProvidenceInstance(Vector2 drawOffset, Color? colorOverride)
|
||||
{
|
||||
// This night bool is used for any off-color activity
|
||||
@@ -2365,125 +2352,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
return false;
|
||||
}
|
||||
|
||||
public void DrawInfernoBorder(SpriteBatch spriteBatch, float skyIntensity, Rectangle screenRect, Color color)
|
||||
{
|
||||
|
||||
if (borderStartEnd.Key > 0f && NPC.HasValidTarget && !Main.dedServ)
|
||||
{
|
||||
if (!validatePlayer(Main.myPlayer))
|
||||
return;
|
||||
|
||||
Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone;
|
||||
Main.instance.GraphicsDevice.RasterizerState.ScissorTestEnable = true;
|
||||
Main.instance.GraphicsDevice.ScissorRectangle = screenRect; //offscreen culling
|
||||
|
||||
var target = Main.player[Main.myPlayer];
|
||||
float targetDist = (target.Center - NPC.Center).Length();
|
||||
//if (targetDist < borderStartEnd.Key) //do not draw, end early
|
||||
//return false;
|
||||
|
||||
var burnItAll = target.HasBuff<HolyInferno>();
|
||||
|
||||
if (false)
|
||||
{
|
||||
List<VertexPosition2DColor> vertices = new();
|
||||
float points = 250; //This may seem excessive, but each point provides a smoother circle which looks better, if you have 4 points you have a diamond border that doesn't accurately represent the shape of the aoe for instance.
|
||||
float width = 150f;
|
||||
float radius = borderStartEnd.Value - (width - 50f); //you have to be outside of the ring for it to matter
|
||||
//Color color = Color.Lerp(Color.Yellow, Color.OrangeRed, 0.5f);
|
||||
var playerCenter = target.Center; //this is outside of the loop due to performance impact, though the value is still needed in the loop regardless
|
||||
|
||||
|
||||
for (int i = 0; i <= points; i++)
|
||||
{
|
||||
float interp = i / points;
|
||||
Vector2 position = NPC.Center - Main.screenPosition + (i * MathHelper.TwoPi / points).ToRotationVector2() * radius;
|
||||
Vector2 position2 = NPC.Center - Main.screenPosition + (i * MathHelper.TwoPi / points).ToRotationVector2() * (radius + width);
|
||||
|
||||
Vector2 textureCoords = new(interp, 0f);
|
||||
Vector2 textureCoords2 = new(interp, 1f);
|
||||
|
||||
// Get the distance to the middle of the current section.
|
||||
float distanceToSection = Vector2.Distance(Vector2.Lerp(position, position2, 0.5f), playerCenter - Main.screenPosition);
|
||||
// And get the correct opacity based on it.
|
||||
float opacity = burnItAll ? 1f : Utils.GetLerpValue(600f, 200f, distanceToSection, true);
|
||||
|
||||
if (opacity > 0f) //only add them for drawing in the event they need to be drawn
|
||||
{
|
||||
vertices.Add(new VertexPosition2DColor(position, color * opacity, textureCoords));
|
||||
vertices.Add(new VertexPosition2DColor(position2, color * opacity, textureCoords2));
|
||||
}
|
||||
}
|
||||
|
||||
//var lerpVal = Utils.GetLerpValue(borderStartEnd.Key, borderStartEnd.Value, targetDist);
|
||||
//float borderOpacityMult = MathHelper.Clamp(MathHelper.Lerp(0f, 0.55f, lerpVal), 0f, 0.55f);
|
||||
float opacity_ = MathHelper.Clamp(Utils.GetLerpValue(500f, 200f, targetDist, true), 0f, 1f);
|
||||
CalamityUtils.CalculatePerspectiveMatricies(out var view, out var projection);
|
||||
var shader = GameShaders.Misc["CalamityMod:AoeBorder"];
|
||||
shader.UseOpacity(opacity_);
|
||||
shader.UseColor(Color.Orange);
|
||||
shader.SetShaderTexture(ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2", AssetRequestMode.ImmediateLoad));
|
||||
shader.Shader.Parameters["uWorldViewProjection"].SetValue(view * projection);
|
||||
shader.Shader.Parameters["noiseSpeed"].SetValue(new Vector2(0.1f, 0.1f));
|
||||
shader.Shader.Parameters["timeFactor"].SetValue(2f);
|
||||
shader.Apply();
|
||||
|
||||
Main.graphics.GraphicsDevice.Textures[0] = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/EdgeGradient", AssetRequestMode.ImmediateLoad).Value;
|
||||
Main.graphics.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, vertices.ToArray(), 0, vertices.Count - 2);
|
||||
}
|
||||
|
||||
//big
|
||||
if (true)
|
||||
{
|
||||
|
||||
float opacity_ = MathHelper.Clamp(Utils.GetLerpValue(borderStartEnd.Key, borderStartEnd.Value, targetDist, true) * skyIntensity, 0f, 1f);
|
||||
var blackTile = TextureAssets.MagicPixel;
|
||||
var circleNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/HarshNoise");
|
||||
var burnNoise = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Noise/GrittyNoise");
|
||||
Vector2 circleScale = new Vector2(MathF.Max(Main.screenWidth, Main.screenHeight));
|
||||
Vector2 anchorPoint = NPC.Center - Main.screenPosition;
|
||||
|
||||
//float cutoff = radius / length(circleScale);
|
||||
//float infernoCutOffset = (uv.y * 74 + adjustedTime * 4.56) * 50 / circleScale.x;
|
||||
//float opacity = InverseLerp(cutoff * 0.8, cutoff, distanceFromCenter);
|
||||
Main.NewText("cutoff: " + (borderStartEnd.Value * 1.41f) / (circleScale.Length() * 5f));
|
||||
//Main.NewText();
|
||||
|
||||
var shader = GameShaders.Misc["CalamityMod:HolyInfernoShader"].Shader;
|
||||
shader.Parameters["color"].SetValue(color.ToVector4() * opacity_); //I want you to know it took considerable restraint to deliberately misspell colour.
|
||||
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
|
||||
shader.Parameters["circleScale"].SetValue(circleScale * 5f);
|
||||
shader.Parameters["radius"].SetValue(borderStartEnd.Value * 1.41f);
|
||||
shader.Parameters["anchorPoint"].SetValue(anchorPoint);
|
||||
shader.Parameters["screenPosition"].SetValue(Main.screenPosition);
|
||||
shader.Parameters["screenSize"].SetValue(Main.ScreenSize.ToVector2());
|
||||
|
||||
spriteBatch.GraphicsDevice.Textures[1] = circleNoise.Value;
|
||||
spriteBatch.GraphicsDevice.Textures[2] = burnNoise.Value;
|
||||
|
||||
|
||||
Main.spriteBatch.End();
|
||||
Main.spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, Main.Rasterizer, shader, Main.GameViewMatrix.TransformationMatrix);
|
||||
//Texture2D texture, Rectangle destinationRectangle, Rectangle? sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth
|
||||
//Main.spriteBatch.Draw(blackTile.Value, drawPosition, null, color, 0f, blackTile.Value.Size() * 0.5f, circleScale / blackTile.Size(), 0, 0f);
|
||||
Rectangle rekt = new(Main.screenWidth / 2, Main.screenHeight / 2, Main.screenWidth, Main.screenHeight);
|
||||
spriteBatch.Draw(blackTile.Value, rekt, null, color, 0f, blackTile.Value.Size() * 0.5f, 0, 0f);
|
||||
//spriteBatch.Draw(TextureAssets.BlackTile.Value, screenRect, color * opacity_);
|
||||
Main.spriteBatch.ExitShaderRegion();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//borderToDraw
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool validatePlayer(int player)
|
||||
{
|
||||
return player.WithinBounds(Main.maxPlayers) && Main.player[player].active && !Main.player[player].dead;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
if (NPC.IsABestiaryIconDummy)
|
||||
|
||||
Reference in new issue
Block a user