- 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
33 lines
1.2 KiB
HLSL
33 lines
1.2 KiB
HLSL
sampler baseTexture : register(s0);
|
|
|
|
float opacityCutoffValue;
|
|
float fadeoutPower;
|
|
float overallOpacity;
|
|
|
|
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
|
{
|
|
// Convert the regular coordinates to polar coordinates to get a circle shape.
|
|
float2 centeredCoords = coords - 0.5;
|
|
float polarAngle = atan2(centeredCoords.y, centeredCoords.x) / 6.283;
|
|
float distanceToCenter = length(centeredCoords);
|
|
|
|
float2 polarCoords = float2(polarAngle, distanceToCenter);
|
|
float4 color = tex2D(baseTexture, coords);
|
|
|
|
// Fade out from the edges of the texture to the middle depending on the cutoff value.
|
|
// "fadeoutPower" values which vary from 1 will affect how strong the edges fade while also increasing the brightness of
|
|
// the non-faded parts of the image to the middle. Use this wisely.
|
|
if (-polarCoords.y < opacityCutoffValue)
|
|
color.rgba *= pow(-polarCoords.y / (polarCoords.y - opacityCutoffValue), -fadeoutPower);
|
|
|
|
return color * sampleColor * overallOpacity;
|
|
}
|
|
|
|
technique Technique1
|
|
{
|
|
pass CircularOpacityPass
|
|
{
|
|
PixelShader = compile ps_2_0 PixelShaderFunction();
|
|
}
|
|
}
|