Reduced visual clutter of Phoenix's Pride spin I had started balancing stuff before realizing I wasn't fully satisfied with the actual functionalities thus the Andromeda's Stride nerf; Polaris' Gaze's current effect needs to be shot in a ditch
76 lines
2.1 KiB
HLSL
76 lines
2.1 KiB
HLSL
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;
|
|
float4 uShaderSpecificData;
|
|
|
|
struct VertexShaderInput
|
|
{
|
|
float4 Position : POSITION0;
|
|
float4 Color : COLOR0;
|
|
float3 TextureCoordinates : TEXCOORD0;
|
|
};
|
|
|
|
struct VertexShaderOutput
|
|
{
|
|
float4 Position : SV_POSITION;
|
|
float4 Color : COLOR0;
|
|
float3 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.
|
|
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
|
{
|
|
float4 color = input.Color;
|
|
float2 coords = input.TextureCoordinates;
|
|
|
|
// Account for texture distortion artifacts.
|
|
coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5;
|
|
|
|
// Read the fade map as a streak.
|
|
float fadeMapY = frac(coords.x - uTime * 1.4 * uSaturation);
|
|
float4 fadeMapColor = tex2D(uImage1, float2(coords.y, fadeMapY));
|
|
fadeMapColor.r *= pow(coords.x, 0.2);
|
|
|
|
float opacity = lerp(1.45, 1.95, fadeMapColor.r) * color.a;
|
|
opacity *= pow(sin(coords.y * 3.141), lerp(1, 4, pow(coords.x, 2)));
|
|
opacity *= fadeMapColor.r * 1.5 + 1;
|
|
opacity *= lerp(0.4, 0.9, fadeMapColor.r);
|
|
opacity *= uOpacity;
|
|
|
|
float3 transformColor = lerp(float3(1, 205 / 255.0, 119 / 255.0), float3(1, 76 / 255.0, 79 / 255.0), fadeMapColor.r);
|
|
color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r);
|
|
return color * opacity * 1.6;
|
|
}
|
|
|
|
technique Technique1
|
|
{
|
|
pass TrailPass
|
|
{
|
|
VertexShader = compile vs_2_0 VertexShaderFunction();
|
|
PixelShader = compile ps_2_0 PixelShaderFunction();
|
|
}
|
|
}
|