diff --git a/Effects/ArtAttackTrail.fx b/Effects/ArtAttackTrail.fx index 61cb900fa9..b91dddd7ce 100644 --- a/Effects/ArtAttackTrail.fx +++ b/Effects/ArtAttackTrail.fx @@ -14,6 +14,7 @@ float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; float shouldFlip; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/ArtAttackTrail.xnb b/Effects/ArtAttackTrail.xnb index 4878feff50..231853e120 100644 Binary files a/Effects/ArtAttackTrail.xnb and b/Effects/ArtAttackTrail.xnb differ diff --git a/Effects/BasicTint.fx b/Effects/BasicTint.fx index 003bcfc900..8b3b2268c2 100644 --- a/Effects/BasicTint.fx +++ b/Effects/BasicTint.fx @@ -12,8 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; - - +float4 uShaderSpecificData; float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/BasicTint.xnb b/Effects/BasicTint.xnb index 14e02d675c..7d2ca5de7b 100644 Binary files a/Effects/BasicTint.xnb and b/Effects/BasicTint.xnb differ diff --git a/Effects/BordernadoFire.fx b/Effects/BordernadoFire.fx index f21b52ac0d..45eab761c8 100644 --- a/Effects/BordernadoFire.fx +++ b/Effects/BordernadoFire.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/BordernadoFire.xnb b/Effects/BordernadoFire.xnb index 9442fdfed4..3d702a7dda 100644 Binary files a/Effects/BordernadoFire.xnb and b/Effects/BordernadoFire.xnb differ diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 2bc2db0fe0..2b57b0497e 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -1,5 +1,6 @@ -using CalamityMod.Skies; +using CalamityMod.Skies; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; @@ -43,33 +44,33 @@ namespace CalamityMod.Effects if (Main.dedServ) return; - AstralFogShader = CalamityMod.Instance.Assets.Request("Effects/CustomShader").Value; - LightShader = CalamityMod.Instance.Assets.Request("Effects/LightBurstShader").Value; - TentacleShader = CalamityMod.Instance.Assets.Request("Effects/TentacleShader").Value; - TeleportDisplacementShader = CalamityMod.Instance.Assets.Request("Effects/TeleportDisplacementShader").Value; - SCalMouseShader = CalamityMod.Instance.Assets.Request("Effects/SCalMouseShader").Value; - LightDistortionShader = CalamityMod.Instance.Assets.Request("Effects/DistortionShader").Value; - PhaseslayerRipShader = CalamityMod.Instance.Assets.Request("Effects/PhaseslayerRipShader").Value; - ScarletDevilShader = CalamityMod.Instance.Assets.Request("Effects/ScarletDevilStreak").Value; - BordernadoFireShader = CalamityMod.Instance.Assets.Request("Effects/BordernadoFire").Value; - PrismCrystalShader = CalamityMod.Instance.Assets.Request("Effects/PrismCrystalStreak").Value; - FadedUVMapStreakShader = CalamityMod.Instance.Assets.Request("Effects/FadedUVMapStreak").Value; - FlameStreakShader = CalamityMod.Instance.Assets.Request("Effects/Flame").Value; - FadingSolidTrailShader = CalamityMod.Instance.Assets.Request("Effects/FadingSolidTrail").Value; - ImpFlameTrailShader = CalamityMod.Instance.Assets.Request("Effects/ImpFlameTrail").Value; - SCalShieldShader = CalamityMod.Instance.Assets.Request("Effects/SupremeShieldShader").Value; - RancorMagicCircleShader = CalamityMod.Instance.Assets.Request("Effects/RancorMagicCircle").Value; - BasicTintShader = CalamityMod.Instance.Assets.Request("Effects/BasicTint").Value; - CircularBarShader = CalamityMod.Instance.Assets.Request("Effects/CircularBarShader").Value; - CircularBarSpriteShader = CalamityMod.Instance.Assets.Request("Effects/CircularBarSpriteShader").Value; - DoGDisintegrationShader = CalamityMod.Instance.Assets.Request("Effects/DoGDisintegration").Value; - ArtAttackTrailShader = CalamityMod.Instance.Assets.Request("Effects/ArtAttackTrail").Value; - CircularAoETelegraph = CalamityMod.Instance.Assets.Request("Effects/CircularAoETelegraph").Value; - IntersectionClipShader = CalamityMod.Instance.Assets.Request("Effects/IntersectionClipShader").Value; - LocalLinearTransformationShader = CalamityMod.Instance.Assets.Request("Effects/LocalLinearTransformationShader").Value; + AstralFogShader = CalamityMod.Instance.Assets.Request("Effects/CustomShader", AssetRequestMode.ImmediateLoad).Value; + LightShader = CalamityMod.Instance.Assets.Request("Effects/LightBurstShader", AssetRequestMode.ImmediateLoad).Value; + TentacleShader = CalamityMod.Instance.Assets.Request("Effects/TentacleShader", AssetRequestMode.ImmediateLoad).Value; + TeleportDisplacementShader = CalamityMod.Instance.Assets.Request("Effects/TeleportDisplacementShader", AssetRequestMode.ImmediateLoad).Value; + SCalMouseShader = CalamityMod.Instance.Assets.Request("Effects/SCalMouseShader", AssetRequestMode.ImmediateLoad).Value; + LightDistortionShader = CalamityMod.Instance.Assets.Request("Effects/DistortionShader", AssetRequestMode.ImmediateLoad).Value; + PhaseslayerRipShader = CalamityMod.Instance.Assets.Request("Effects/PhaseslayerRipShader", AssetRequestMode.ImmediateLoad).Value; + ScarletDevilShader = CalamityMod.Instance.Assets.Request("Effects/ScarletDevilStreak", AssetRequestMode.ImmediateLoad).Value; + BordernadoFireShader = CalamityMod.Instance.Assets.Request("Effects/BordernadoFire", AssetRequestMode.ImmediateLoad).Value; + PrismCrystalShader = CalamityMod.Instance.Assets.Request("Effects/PrismCrystalStreak", AssetRequestMode.ImmediateLoad).Value; + FadedUVMapStreakShader = CalamityMod.Instance.Assets.Request("Effects/FadedUVMapStreak", AssetRequestMode.ImmediateLoad).Value; + FlameStreakShader = CalamityMod.Instance.Assets.Request("Effects/Flame", AssetRequestMode.ImmediateLoad).Value; + FadingSolidTrailShader = CalamityMod.Instance.Assets.Request("Effects/FadingSolidTrail", AssetRequestMode.ImmediateLoad).Value; + ImpFlameTrailShader = CalamityMod.Instance.Assets.Request("Effects/ImpFlameTrail", AssetRequestMode.ImmediateLoad).Value; + SCalShieldShader = CalamityMod.Instance.Assets.Request("Effects/SupremeShieldShader", AssetRequestMode.ImmediateLoad).Value; + RancorMagicCircleShader = CalamityMod.Instance.Assets.Request("Effects/RancorMagicCircle", AssetRequestMode.ImmediateLoad).Value; + BasicTintShader = CalamityMod.Instance.Assets.Request("Effects/BasicTint", AssetRequestMode.ImmediateLoad).Value; + CircularBarShader = CalamityMod.Instance.Assets.Request("Effects/CircularBarShader", AssetRequestMode.ImmediateLoad).Value; + CircularBarSpriteShader = CalamityMod.Instance.Assets.Request("Effects/CircularBarSpriteShader", AssetRequestMode.ImmediateLoad).Value; + DoGDisintegrationShader = CalamityMod.Instance.Assets.Request("Effects/DoGDisintegration", AssetRequestMode.ImmediateLoad).Value; + ArtAttackTrailShader = CalamityMod.Instance.Assets.Request("Effects/ArtAttackTrail", AssetRequestMode.ImmediateLoad).Value; + CircularAoETelegraph = CalamityMod.Instance.Assets.Request("Effects/CircularAoETelegraph", AssetRequestMode.ImmediateLoad).Value; + IntersectionClipShader = CalamityMod.Instance.Assets.Request("Effects/IntersectionClipShader", AssetRequestMode.ImmediateLoad).Value; + LocalLinearTransformationShader = CalamityMod.Instance.Assets.Request("Effects/LocalLinearTransformationShader", AssetRequestMode.ImmediateLoad).Value; - BaseFusableParticleEdgeShader = CalamityMod.Instance.Assets.Request("Effects/ParticleFusion/BaseFusableParticleEdgeShader").Value; - AdditiveFusableParticleEdgeShader = CalamityMod.Instance.Assets.Request("Effects/ParticleFusion/AdditiveFusableParticleEdgeShader").Value; + BaseFusableParticleEdgeShader = CalamityMod.Instance.Assets.Request("Effects/ParticleFusion/BaseFusableParticleEdgeShader", AssetRequestMode.ImmediateLoad).Value; + AdditiveFusableParticleEdgeShader = CalamityMod.Instance.Assets.Request("Effects/ParticleFusion/AdditiveFusableParticleEdgeShader", AssetRequestMode.ImmediateLoad).Value; DoGPortalShader = CalamityMod.Instance.Assets.Request("Effects/ScreenShaders/DoGPortalShader").Value; @@ -81,7 +82,6 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:FireMouse"] = new MiscShaderData(new Ref(SCalMouseShader), "DyePass"); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); GameShaders.Misc["CalamityMod:TeleportDisplacement"] = new MiscShaderData(new Ref(TeleportDisplacementShader), "GlitchPass"); - GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); GameShaders.Misc["CalamityMod:TrailStreak"] = new MiscShaderData(new Ref(FadedUVMapStreakShader), "TrailPass"); GameShaders.Misc["CalamityMod:Flame"] = new MiscShaderData(new Ref(FlameStreakShader), "TrailPass"); diff --git a/Effects/CircularAoETelegraph.fx b/Effects/CircularAoETelegraph.fx index fe5cddcf51..8869e25295 100644 --- a/Effects/CircularAoETelegraph.fx +++ b/Effects/CircularAoETelegraph.fx @@ -12,7 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; - +float4 uShaderSpecificData; float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/CircularAoETelegraph.xnb b/Effects/CircularAoETelegraph.xnb index 9696a04ba6..ba4a7077de 100644 Binary files a/Effects/CircularAoETelegraph.xnb and b/Effects/CircularAoETelegraph.xnb differ diff --git a/Effects/CircularBarShader.fx b/Effects/CircularBarShader.fx index 718b5d716e..646b62ef01 100644 --- a/Effects/CircularBarShader.fx +++ b/Effects/CircularBarShader.fx @@ -12,6 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float4 uShaderSpecificData; float4 MainPS(float2 coords : TEXCOORD0) : COLOR { diff --git a/Effects/CircularBarShader.xnb b/Effects/CircularBarShader.xnb index 5c43263148..bfd24d480b 100644 Binary files a/Effects/CircularBarShader.xnb and b/Effects/CircularBarShader.xnb differ diff --git a/Effects/CircularBarSpriteShader.fx b/Effects/CircularBarSpriteShader.fx index 38e979b9d6..de4b908ddb 100644 --- a/Effects/CircularBarSpriteShader.fx +++ b/Effects/CircularBarSpriteShader.fx @@ -12,6 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float4 uShaderSpecificData; float4 MainPS(float2 coords : TEXCOORD0) : COLOR { diff --git a/Effects/CircularBarSpriteShader.xnb b/Effects/CircularBarSpriteShader.xnb index ce41e5ea71..75068092d9 100644 Binary files a/Effects/CircularBarSpriteShader.xnb and b/Effects/CircularBarSpriteShader.xnb differ diff --git a/Effects/DoGDisintegration.fx b/Effects/DoGDisintegration.fx index f3aa4829c5..7473ea481a 100644 --- a/Effects/DoGDisintegration.fx +++ b/Effects/DoGDisintegration.fx @@ -12,6 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float4 uShaderSpecificData; // This shader is largely based on code used for ExampleMod's cool death animation thing; it is suprisingly useful for this use case. float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0 diff --git a/Effects/DoGDisintegration.xnb b/Effects/DoGDisintegration.xnb index 74ece6cc70..5e7e84b439 100644 Binary files a/Effects/DoGDisintegration.xnb and b/Effects/DoGDisintegration.xnb differ diff --git a/Effects/FabstaffStreak.fx b/Effects/FabstaffStreak.fx deleted file mode 100644 index 497063c9da..0000000000 --- a/Effects/FabstaffStreak.fx +++ /dev/null @@ -1,72 +0,0 @@ -sampler uImage0 : register(s0); -sampler uImage1 : register(s1); -float3 uColor; -float3 uSecondaryColor; -float uOpacity; -float uSaturation; -float uRotation; -float uTime; -float4 uSourceRect; -float2 uWorldPosition; -float uDirection; -float3 uLightSource; -float2 uImageSize0; -float2 uImageSize1; -matrix uWorldViewProjection; - -struct VertexShaderInput -{ - float4 Position : POSITION0; - float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; -}; - -struct VertexShaderOutput -{ - float4 Position : SV_POSITION; - float4 Color : COLOR0; - float2 TextureCoordinates : TEXCOORD0; -}; - -VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) -{ - VertexShaderOutput output = (VertexShaderOutput)0; - float4 pos = mul(input.Position, uWorldViewProjection); - output.Position = pos; - - output.Color = input.Color; - output.TextureCoordinates = input.TextureCoordinates; - - return output; -} - -// The X coordinate is the trail completion, the Y coordinate is the same as any other. -// This is simply how the primitive TextCoord is layed out in the C# code. -float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 -{ - float4 color = input.Color; - float2 coords = input.TextureCoordinates; - - // Read the fade map as a streak. - float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x - uTime * 2.5), coords.y)); - float opacity = fadeMapColor.r; - - // Fade out at the edges of the trail to give a blur effect. - // This is very important. - float power = lerp(3, 10, coords.x); - opacity = lerp(pow(sin(coords.y * 3.141), power), opacity, coords.x); - - // Fade out at the end of the streak. - if (coords.x > 0.7) - opacity *= pow(1 - (coords.x - 0.7) / 0.3, 6); - return color * opacity * 1.5; -} - -technique Technique1 -{ - pass TrailPass - { - VertexShader = compile vs_2_0 VertexShaderFunction(); - PixelShader = compile ps_2_0 PixelShaderFunction(); - } -} diff --git a/Effects/FabstaffStreak.xnb b/Effects/FabstaffStreak.xnb deleted file mode 100644 index d8ae178aed..0000000000 Binary files a/Effects/FabstaffStreak.xnb and /dev/null differ diff --git a/Effects/FadedUVMapStreak.fx b/Effects/FadedUVMapStreak.fx index 497063c9da..906d2ded1f 100644 --- a/Effects/FadedUVMapStreak.fx +++ b/Effects/FadedUVMapStreak.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/FadedUVMapStreak.xnb b/Effects/FadedUVMapStreak.xnb index ab7ac0bf48..cba3a873a1 100644 Binary files a/Effects/FadedUVMapStreak.xnb and b/Effects/FadedUVMapStreak.xnb differ diff --git a/Effects/FadingSolidTrail.fx b/Effects/FadingSolidTrail.fx index 5b8427dcff..4aaf9c8139 100644 --- a/Effects/FadingSolidTrail.fx +++ b/Effects/FadingSolidTrail.fx @@ -14,6 +14,7 @@ float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; float shouldFlip; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/FadingSolidTrail.xnb b/Effects/FadingSolidTrail.xnb index b9c678eac6..f97fe09680 100644 Binary files a/Effects/FadingSolidTrail.xnb and b/Effects/FadingSolidTrail.xnb differ diff --git a/Effects/Flame.fx b/Effects/Flame.fx index 2fa2e1ffe6..4ad80c2865 100644 --- a/Effects/Flame.fx +++ b/Effects/Flame.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/Flame.xnb b/Effects/Flame.xnb index b3778d965b..5bee1c229a 100644 Binary files a/Effects/Flame.xnb and b/Effects/Flame.xnb differ diff --git a/Effects/ImpFlameTrail.fx b/Effects/ImpFlameTrail.fx index b2e2d4b511..ea13593261 100644 --- a/Effects/ImpFlameTrail.fx +++ b/Effects/ImpFlameTrail.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/ImpFlameTrail.xnb b/Effects/ImpFlameTrail.xnb index bcd88aeb37..fc33169629 100644 Binary files a/Effects/ImpFlameTrail.xnb and b/Effects/ImpFlameTrail.xnb differ diff --git a/Effects/IntersectionClipShader.fx b/Effects/IntersectionClipShader.fx index 2a8e4fd1b4..cce7b32bee 100644 --- a/Effects/IntersectionClipShader.fx +++ b/Effects/IntersectionClipShader.fx @@ -16,6 +16,7 @@ float uIntersectionCutoffDirection; float2 uIntersectionPosition; float2 uIntersectionNormal; float2 uSize; +float4 uShaderSpecificData; float2 RotatedBy(float2 xy, float theta) { diff --git a/Effects/IntersectionClipShader.xnb b/Effects/IntersectionClipShader.xnb index 4bf7581701..39031b6a83 100644 Binary files a/Effects/IntersectionClipShader.xnb and b/Effects/IntersectionClipShader.xnb differ diff --git a/Effects/LocalLinearTransformationShader.fx b/Effects/LocalLinearTransformationShader.fx index 54c411a842..8004126e9e 100644 --- a/Effects/LocalLinearTransformationShader.fx +++ b/Effects/LocalLinearTransformationShader.fx @@ -16,6 +16,7 @@ float2 uImageSize1; float2 overallImageSize; matrix uWorldViewProjection; float2x2 localMatrix; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/LocalLinearTransformationShader.xnb b/Effects/LocalLinearTransformationShader.xnb index a4edfa8d9d..9704f12e44 100644 Binary files a/Effects/LocalLinearTransformationShader.xnb and b/Effects/LocalLinearTransformationShader.xnb differ diff --git a/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.fx b/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.fx index 0181c7fec2..39398fc2f4 100644 --- a/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.fx +++ b/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.fx @@ -21,6 +21,7 @@ float2 screenMoveOffset; float2 generalBackgroundOffset; bool invertedScreen; float2 upscaleFactor; +float4 uShaderSpecificData; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.xnb b/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.xnb index c60b672f5d..30addac8a6 100644 Binary files a/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.xnb and b/Effects/ParticleFusion/AdditiveFusableParticleEdgeShader.xnb differ diff --git a/Effects/ParticleFusion/BaseFusableParticleEdgeShader.fx b/Effects/ParticleFusion/BaseFusableParticleEdgeShader.fx index 77470954e8..e4155db9b9 100644 --- a/Effects/ParticleFusion/BaseFusableParticleEdgeShader.fx +++ b/Effects/ParticleFusion/BaseFusableParticleEdgeShader.fx @@ -21,6 +21,7 @@ float2 screenMoveOffset; float2 generalBackgroundOffset; bool invertedScreen; float2 upscaleFactor; +float4 uShaderSpecificData; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/ParticleFusion/BaseFusableParticleEdgeShader.xnb b/Effects/ParticleFusion/BaseFusableParticleEdgeShader.xnb index e689e96ed6..c544bbed01 100644 Binary files a/Effects/ParticleFusion/BaseFusableParticleEdgeShader.xnb and b/Effects/ParticleFusion/BaseFusableParticleEdgeShader.xnb differ diff --git a/Effects/PhaseslayerRipShader.fx b/Effects/PhaseslayerRipShader.fx index 5f2870b13b..1df56dcc69 100644 --- a/Effects/PhaseslayerRipShader.fx +++ b/Effects/PhaseslayerRipShader.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/PhaseslayerRipShader.xnb b/Effects/PhaseslayerRipShader.xnb index 2f504e3583..037098c6a9 100644 Binary files a/Effects/PhaseslayerRipShader.xnb and b/Effects/PhaseslayerRipShader.xnb differ diff --git a/Effects/PrismCrystalStreak.fx b/Effects/PrismCrystalStreak.fx index 8ec86f9cd3..ce7a206a52 100644 --- a/Effects/PrismCrystalStreak.fx +++ b/Effects/PrismCrystalStreak.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/PrismCrystalStreak.xnb b/Effects/PrismCrystalStreak.xnb index 56f4eaa121..dac8824f97 100644 Binary files a/Effects/PrismCrystalStreak.xnb and b/Effects/PrismCrystalStreak.xnb differ diff --git a/Effects/RancorMagicCircle.fx b/Effects/RancorMagicCircle.fx index 375d8b56c1..17e809a437 100644 --- a/Effects/RancorMagicCircle.fx +++ b/Effects/RancorMagicCircle.fx @@ -15,6 +15,7 @@ float2 uImageSize0; float2 uImageSize1; float2 overallImageSize; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/RancorMagicCircle.xnb b/Effects/RancorMagicCircle.xnb index d93da9d17d..19b478d5d5 100644 Binary files a/Effects/RancorMagicCircle.xnb and b/Effects/RancorMagicCircle.xnb differ diff --git a/Effects/SCalMouseShader.fx b/Effects/SCalMouseShader.fx index 07151bc3b6..4a8a4e1b7e 100644 --- a/Effects/SCalMouseShader.fx +++ b/Effects/SCalMouseShader.fx @@ -12,6 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float4 uShaderSpecificData; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/SCalMouseShader.xnb b/Effects/SCalMouseShader.xnb index a3a34f5e0a..c487fa5b59 100644 Binary files a/Effects/SCalMouseShader.xnb and b/Effects/SCalMouseShader.xnb differ diff --git a/Effects/ScarletDevilStreak.fx b/Effects/ScarletDevilStreak.fx index b79f4db97e..a037bd7333 100644 --- a/Effects/ScarletDevilStreak.fx +++ b/Effects/ScarletDevilStreak.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float4 uShaderSpecificData; struct VertexShaderInput { diff --git a/Effects/ScarletDevilStreak.xnb b/Effects/ScarletDevilStreak.xnb index 7e4df7a9c9..001a8926bd 100644 Binary files a/Effects/ScarletDevilStreak.xnb and b/Effects/ScarletDevilStreak.xnb differ diff --git a/Effects/ScreenShaders/DoGPortalShader.fx b/Effects/ScreenShaders/DoGPortalShader.fx index 412a346aa0..73d04d57eb 100644 --- a/Effects/ScreenShaders/DoGPortalShader.fx +++ b/Effects/ScreenShaders/DoGPortalShader.fx @@ -12,6 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float4 uShaderSpecificData; float4 PixelShaderFunction(float4 position : SV_POSITION, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/ScreenShaders/DoGPortalShader.xnb b/Effects/ScreenShaders/DoGPortalShader.xnb index 3b21a28dc0..9f6614c6f8 100644 Binary files a/Effects/ScreenShaders/DoGPortalShader.xnb and b/Effects/ScreenShaders/DoGPortalShader.xnb differ diff --git a/Effects/SupremeShieldShader.fx b/Effects/SupremeShieldShader.fx index b91aff9481..1d6c602e77 100644 --- a/Effects/SupremeShieldShader.fx +++ b/Effects/SupremeShieldShader.fx @@ -12,6 +12,7 @@ float uDirection; float3 uLightSource; float2 uImageSize0; float2 uImageSize1; +float4 uShaderSpecificData; float inverseLerp(float x, float min, float max) { diff --git a/Effects/SupremeShieldShader.xnb b/Effects/SupremeShieldShader.xnb index 69517504b6..848fa21dcd 100644 Binary files a/Effects/SupremeShieldShader.xnb and b/Effects/SupremeShieldShader.xnb differ diff --git a/Effects/TeleportDisplacementShader.fx b/Effects/TeleportDisplacementShader.fx index 89eb599ac5..063c426174 100644 --- a/Effects/TeleportDisplacementShader.fx +++ b/Effects/TeleportDisplacementShader.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; float2 frameCount; +float4 uShaderSpecificData; float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 { diff --git a/Effects/TeleportDisplacementShader.xnb b/Effects/TeleportDisplacementShader.xnb index e36cadd48d..2e53b4830b 100644 Binary files a/Effects/TeleportDisplacementShader.xnb and b/Effects/TeleportDisplacementShader.xnb differ diff --git a/Effects/TentacleShader.fx b/Effects/TentacleShader.fx new file mode 100644 index 0000000000..c8ec234afb --- /dev/null +++ b/Effects/TentacleShader.fx @@ -0,0 +1,45 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +float4 uShaderSpecificData; + +float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +{ + float trailLengthRatio = uSaturation + (coords.x + coords.y) / 2 * uOpacity; + + float r = (sin(uTime + trailLengthRatio * 12.566) + 1) * 0.5; + float g = (-cos(uTime + trailLengthRatio * 12.566) + 1) * 0.5; + float b = (-sin(uTime + trailLengthRatio * 12.566) + 1) * 0.5; + + float a = (trailLengthRatio * 0.5 + 0.5) * (abs(coords.x - 0.5)) / 0.5; + a *= tex2D(uImage1, coords).r; + + float4 returnColor = float4(r, g, b, a); + + float whiteness = 0; + + if (trailLengthRatio > 0.7) + whiteness = (trailLengthRatio - 0.7) / 0.3; + + returnColor.rgb = lerp(returnColor.rgb, float3(1, 1, 1), whiteness) * trailLengthRatio * 0.6; + + return returnColor * tex2D(uImage0, coords); +} +technique Technique1 +{ + pass BurstPass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/TentacleShader.xnb b/Effects/TentacleShader.xnb index 02171ce264..e9d34c45ad 100644 Binary files a/Effects/TentacleShader.xnb and b/Effects/TentacleShader.xnb differ diff --git a/Items/Armor/GodSlayerHelm.cs b/Items/Armor/GodSlayerHelm.cs index 7bcbac3611..774208831e 100644 --- a/Items/Armor/GodSlayerHelm.cs +++ b/Items/Armor/GodSlayerHelm.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.godSlayer = true; modPlayer.godSlayerDamage = true; - string hotkey = CalamityMod.GodSlayerDashHotKey.TooltipHotkeyString(); + string hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = "Allows you to dash for an immense distance in 8 directions\n" + "Press " + hotkey + " while holding down the movement keys in the direction you want to dash\n" + "Enemies you dash through take massive damage\n" + diff --git a/Items/Armor/GodSlayerHelmet.cs b/Items/Armor/GodSlayerHelmet.cs index 942a50718f..374ff998a1 100644 --- a/Items/Armor/GodSlayerHelmet.cs +++ b/Items/Armor/GodSlayerHelmet.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.godSlayer = true; modPlayer.godSlayerRanged = true; - string hotkey = CalamityMod.GodSlayerDashHotKey.TooltipHotkeyString(); + string hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = "Allows you to dash for an immense distance in 8 directions\n" + "Press " + hotkey + " while holding down the movement keys in the direction you want to dash\n" + "Enemies you dash through take massive damage\n" + diff --git a/Items/TreasureBags/AquaticScourgeBag.cs b/Items/TreasureBags/AquaticScourgeBag.cs index ad4f33255b..1f8437d994 100644 --- a/Items/TreasureBags/AquaticScourgeBag.cs +++ b/Items/TreasureBags/AquaticScourgeBag.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index 99f487a161..a10136a605 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor, Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor, Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0); return false; } } diff --git a/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs b/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs index 2441d2c2bb..7b40a32503 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Effects; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; @@ -44,14 +45,14 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { Texture2D bladeTexture = ModContent.Request(Texture).Value ; - MiscShaderData distortationShader = GameShaders.Misc["CalamityMod:LightDistortion"]; Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); Rectangle frame = bladeTexture.Frame(1, 5, 0, Projectile.frameCounter / 4 % 5); var drawData2 = new DrawData(bladeTexture, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, bladeTexture.Size() / new Vector2(1f, 5f) * 0.5f, Projectile.scale * 1.2f, SpriteEffects.None, 0); - distortationShader.Apply(drawData2); + + CalamityShaders.LightDistortionShader.CurrentTechnique.Passes[0].Apply(); drawData2.Draw(Main.spriteBatch); return false; diff --git a/Projectiles/Ranged/DaemonsFlameBow.cs b/Projectiles/Ranged/DaemonsFlameBow.cs index a0317a53d3..1ed3287ecd 100644 --- a/Projectiles/Ranged/DaemonsFlameBow.cs +++ b/Projectiles/Ranged/DaemonsFlameBow.cs @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Ranged/DaemonsFlameBowGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Ranged/DaemonsFlameBowGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); } public override bool? CanDamage() => false; diff --git a/Projectiles/Ranged/DrizzlefishFire.cs b/Projectiles/Ranged/DrizzlefishFire.cs index f3284618fb..519a857255 100644 --- a/Projectiles/Ranged/DrizzlefishFire.cs +++ b/Projectiles/Ranged/DrizzlefishFire.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged //Changes the texture of the projectile if (Projectile.ai[1] == 1f) { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2"); + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 16, 16)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/PrismExplosionSmall.cs b/Projectiles/Ranged/PrismExplosionSmall.cs index 3c8cea9b42..cced492954 100644 --- a/Projectiles/Ranged/PrismExplosionSmall.cs +++ b/Projectiles/Ranged/PrismExplosionSmall.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Texture2D texture = ModContent.Request(Texture).Value; - Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/PhotovisceratorLight"); + Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/PhotovisceratorLight").Value; Rectangle frame = texture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Rogue/ShockGrenadeBolt.cs b/Projectiles/Rogue/ShockGrenadeBolt.cs index d5f1c108bb..84d75533be 100644 --- a/Projectiles/Rogue/ShockGrenadeBolt.cs +++ b/Projectiles/Rogue/ShockGrenadeBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -98,9 +98,9 @@ namespace CalamityMod.Projectiles.Rogue { Texture2D sprite; if (Projectile.ai[0] == 0f) - sprite = ModContent.Request("CalamityMod/Projectiles/Rogue/ShockGrenadeBolt"); + sprite = ModContent.Request("CalamityMod/Projectiles/Rogue/ShockGrenadeBolt").Value; else - sprite = ModContent.Request("CalamityMod/Projectiles/Rogue/ShockGrenadeBolt2"); + sprite = ModContent.Request("CalamityMod/Projectiles/Rogue/ShockGrenadeBolt2").Value; Color drawColour = Color.White; Vector2 origin = new Vector2(frameWidth / 2, frameHeight / 2);