Added Astral Flesh Dye

This commit is contained in:
DominicKarma committed 2021-10-06 19:34:13 -05:00
1 parent 2fb3eabbca
commit ce3f6d292f
5 files changed
+75 -1

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
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 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
// Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w;
float updraftXCoord = sin(3.141 * frac(coords.x + 0.56));
float updraftYCoord = sin(3.141 * frac(frameY + uTime * 0.21));
float2 updraftCoords = float2(updraftXCoord, updraftYCoord);
float4 color = tex2D(uImage0, coords);
float4 noiseColor = tex2D(uImage1, float2(coords.x, frameY) * 0.4);
float4 updraftNoiseColor = tex2D(uImage1, updraftCoords * float2(0.05, 0.06));
float4 updraftColor = float4(uSecondaryColor, 1) * pow(updraftNoiseColor.r, 4) * 4.7;
float4 stoneColor = lerp(color, float4(uColor, 1), 0.55) * color.a;
stoneColor.rgb *= 0.2 + noiseColor.r * 0.65;
return (stoneColor + updraftColor * 0.4) * color.a;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Dyes
public override void SafeSetDefaults()
{
item.rare = ItemRarityID.Green;
item.value = Item.sellPrice(0, 1, 20, 0);
item.value = Item.sellPrice(0, 0, 50, 0);
}
public override void AddRecipes()
+36
View File
@@ -0,0 +1,36 @@
using CalamityMod.Items.Placeables;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Dyes
{
public class AstralDye : BaseDye
{
public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref<Effect>(mod.GetEffect("Effects/Dyes/AstralDyeShader")), "DyePass").
UseColor(new Color(123, 99, 130)).UseSecondaryColor(new Color(189, 66, 84)).UseImage("Images/Misc/Perlin");
public override void SafeSetStaticDefaults()
{
DisplayName.SetDefault("Astral Flesh Dye");
}
public override void SafeSetDefaults()
{
item.rare = ItemRarityID.LightRed;
item.value = Item.sellPrice(0, 0, 65, 0);
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BottledWater);
recipe.AddIngredient(ModContent.ItemType<AstralStone>(), 15);
recipe.AddTile(TileID.DyeVat);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B