- Made some visual improvements to DoG's CustomSky, involving the creation of two new shaders, DoGRealityCrackShader and DoGRiftAuraShader - - Descriptions for each can be found in CalamityShaders - Ambient sky entities are now disabled while DoG's CustomSky is active - The code for the distortion rift's lightning effect should now no longer run at all times and only when DoG's CustomSky is active - DoG no longer has its death animation shader applied to all segments individually. Instead, all segments are now drawn to a render target, which is what the shader is then applied to via a new BaseRenderer class, DoGDeathAnimationRenderer. This was done to prevent all of DoG's sprites from suddenly rendering in full brightness during his death animation - - Additionally, DoGDisintegration's code has been cleaned up - Fixed DoG not spawning out of the correct teleport rift projectile on GFB due to not properly accommodating for fake rifts when searching for the correct teleport location - Improved the visuals of DoGTeleportRift and decreased the visual intensity of fake rifts - DoG's teleport rift indicator icon will no longer appear on GFB due to the inclusion of fake rifts as a mechanic on that seed. There are many differences between the real rift and fake rifts which should make up for this
42 lines
1.2 KiB
HLSL
42 lines
1.2 KiB
HLSL
sampler baseTexture : register(s0);
|
|
sampler disintegrationTexture : register(s1);
|
|
|
|
float disintegrationProgress : register(C0);
|
|
float disintegrationScale;
|
|
float2 worldPosition;
|
|
float2 pixelSize;
|
|
|
|
// 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
|
|
{
|
|
float4 color = tex2D(baseTexture, coords);
|
|
if (!any(color))
|
|
return color;
|
|
|
|
coords += worldPosition;
|
|
coords = round(coords * pixelSize) / pixelSize;
|
|
|
|
float disintegration = pow(saturate(1 - disintegrationProgress), 0.7);
|
|
float2 disintegrationCoords = coords * disintegrationScale;
|
|
float4 disintegrationColor = tex2D(disintegrationTexture, disintegrationCoords);
|
|
|
|
float disappearThreshold = disintegration * 1.05;
|
|
if (disintegrationColor.r > disappearThreshold)
|
|
{
|
|
color.rgba = 0;
|
|
}
|
|
else if (disintegrationColor.b > disintegration)
|
|
{
|
|
color = float4(1, 105.0 / 255, 180.0 / 255, 1);
|
|
}
|
|
|
|
return color;
|
|
}
|
|
|
|
technique Technique1
|
|
{
|
|
pass DisintegrationPass
|
|
{
|
|
PixelShader = compile ps_3_0 PixelShaderFunction();
|
|
}
|
|
} |