Fixed arms being a Dimensional Interloper 2
This commit is contained in:
1 parent
04a27a43a2
commit
904edbe245
4 files changed
+60
-24
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Skies;
|
||||
using Iced.Intel;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
@@ -176,6 +177,16 @@ namespace CalamityMod.Effects
|
||||
#region Aqua's Shaders
|
||||
internal static Effect CircularGradientWithEdge;
|
||||
#endregion
|
||||
|
||||
//
|
||||
// All below shaders were added by Amber
|
||||
// Authorship goes to Toasty
|
||||
//
|
||||
|
||||
#region Amber's Shaders
|
||||
internal static Effect PrimitiveClearShader;
|
||||
#endregion
|
||||
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
// All shaders registered this way are accessible under GameShaders.Misc
|
||||
// They will use the prefix described above
|
||||
@@ -373,6 +384,11 @@ namespace CalamityMod.Effects
|
||||
CircularGradientWithEdge = LoadShader("CircularGradientWithEdge");
|
||||
RegisterMiscShader(CircularGradientWithEdge, "CircularGradientWithEdgePass", "CircularGradientWithEdge");
|
||||
#endregion
|
||||
|
||||
#region Loading Amber's Shaders
|
||||
PrimitiveClearShader = LoadShader("PrimitiveClearShader");
|
||||
RegisterScreenShader(PrimitiveClearShader, "SightLinePass", "PrimitiveClearShader");
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
sampler mainImage : register(s0);
|
||||
matrix uWorldViewProjection;
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float2 TextureCoordinates : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float2 TextureCoordinates : TEXCOORD0;
|
||||
float4 Color : COLOR0;
|
||||
};
|
||||
|
||||
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output = (VertexShaderOutput) 0;
|
||||
output.Color = input.Color;
|
||||
output.Position = mul(input.Position, uWorldViewProjection);
|
||||
output.TextureCoordinates = input.TextureCoordinates;
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 color = input.Color;
|
||||
float2 coords = input.TextureCoordinates;
|
||||
|
||||
float4 pixel = tex2D(mainImage, coords);
|
||||
return color * pixel;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass AutoloadPass
|
||||
{
|
||||
VertexShader = compile vs_2_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_2_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
@@ -179,30 +180,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Main.spriteBatch.EnterShaderRegion();
|
||||
|
||||
CalamityUtils.CalculatePerspectiveMatricies(out Matrix viewMatrix, out Matrix projectionMatrix);
|
||||
|
||||
GameShaders.Misc["CalamityMod:LinearTransformation"].UseColor(Main.hslToRgb(0.95f, 0.85f, 0.5f));
|
||||
GameShaders.Misc["CalamityMod:LinearTransformation"].UseOpacity(0f);
|
||||
GameShaders.Misc["CalamityMod:LinearTransformation"].Shader.Parameters["uWorldViewProjection"].SetValue(viewMatrix * projectionMatrix);
|
||||
GameShaders.Misc["CalamityMod:LinearTransformation"].Shader.Parameters["localMatrix"].SetValue(new Matrix()
|
||||
{
|
||||
M11 = BladeHorizontalFactor,
|
||||
M12 = 0f,
|
||||
M21 = 0f,
|
||||
M22 = 1f,
|
||||
});
|
||||
GameShaders.Misc["CalamityMod:LinearTransformation"].Apply();
|
||||
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, 2, lightColor);
|
||||
Main.spriteBatch.ExitShaderRegion();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
ItemLoader.OnHitNPC(Owner.ActiveItem(), Owner, target, hit, damageDone);
|
||||
|
||||
Reference in new issue
Block a user