Files
CalamityModPublic/Effects/BasicTextureDistortionShader.fx
T
fryzahh 6c706dfdef This Swine is Divine (so majestic!)
* Added and almost entirely implemented Divine Swine. Visuals and some minor parts of he functionality are still a WIP.
* Flipped the Piggy and PiggyGold sprites to be consistent with every other NPC sprite.
* Added ArcCollisionCheck to CollisionUtils.
* Updated DistanceToTileCollisionHit to accept a new Func parameter, allowing for writing custom tile validity logic.
* Added SubtractiveBlending to DrawingUtils.
* Added ChromaticAbberationShader and updated BasicTextureDistortionShader.
2026-03-28 23:48:41 -04:00

23 lines
617 B
HLSL

sampler baseTexture : register(s0);
sampler distortionTexture : register(s1);
float time;
float noiseScale;
float distortionStrength;
float2 timeOffset;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR
{
float2 distortedCoords = coords + float2(time * timeOffset.x, time * timeOffset.y);
float distortion = tex2D(distortionTexture, distortedCoords * noiseScale).r;
return tex2D(baseTexture, coords + distortion * distortionStrength);
}
technique Technique1
{
pass DistortionPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}