Fixed pretty much all dye shaders + Stream Gouge

This commit is contained in:
Dominic committed 2022-06-03 00:14:22 -05:00
1 parent eb5b0f8d85
commit 46eb2b5a01
55 files changed
+74 -74

No files matched your search

+2 -2
View File
@@ -29,7 +29,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
@@ -52,7 +52,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
float4 metalColor = lerp(color, float4(BlendColor(color.rgb * 0.6, uColor), 1), 0.7);
// And mix it all together.
return (color * 0.35 + metalColor * 0.65 + updraftColor * 0.8 + cloudColor * 0.3) * color.a * 0.85;
return (color * 0.35 + metalColor * 0.65 + updraftColor * 0.8 + cloudColor * 0.3) * color.a * sampleColor * 0.85;
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -21,13 +21,13 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
float interval = cos(uTime * 7 + framedCoords.x * 4) / 2 + 0.5;
float4 returnColor = float4(lerp(uColor, uSecondaryColor, interval), 1); // Fade between two colors depending on the time and x position on the texture in a 0-1 cosine linear interpolation. The color can vary.
return returnColor * color; // And multiply by the original color to give it a blend effect.
return returnColor * sampleColor * color; // And multiply by the original color to give it a blend effect.
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
@@ -42,7 +42,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
// Become notably darker to reinforce the stone aesthetic.
stoneColor.rgb *= 0.2 + noiseColor.r * 0.65;
return (stoneColor + flameColor * 0.4) * color.a;
return (stoneColor + flameColor * 0.4) * sampleColor * color.a;
}
technique Technique1
{
Binary file not shown.
+3 -3
View File
@@ -21,14 +21,14 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
float interval = (cos((uTime - 0.5) * 17 + framedCoords.y * 8) / 2 + 0.5);
float interval = (sin((uTime - 0.5) * 17 + framedCoords.y * 8) / 2 + 0.5);
float4 returnColor = float4(lerp(uColor, uSecondaryColor, interval), 1); // One again, use a cosine lerp based on position and time, but this time, with the Y position.
return returnColor * color;
return returnColor * color * sampleColor;
}
technique Technique1
{
Binary file not shown.
+5 -5
View File
@@ -26,18 +26,18 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
float interval = (cos(uTime * 2.2 + framedCoords.x * framedCoords.y * 1.55) * 0.5 + 0.5) * 0.6 + 0.2; // A complex function that works based on the X and Y coords with a 0.2-0.8 range.
float interval = (sin(uTime * 2.2 + framedCoords.x * framedCoords.y * 1.55 + 1.57) * 0.5 + 0.5) * 0.6 + 0.2; // A complex function that works based on the X and Y coords with a 0.2-0.8 range.
float brightness = 1.35;
float3 returnColor = uColor;
// Rotate the colors around and adjust the brightness.
for (int i = 0; i < 4; i++)
{
float2 positionAt = float2(interval, 1 - interval);
positionAt = (RotatedBy(float2(cos(uTime * 1.7 + i / 4 * 6.283), cos(uTime * 1.9 + i / 4 * 6.283)), uTime + i / 4 * 6.283) * 0.5 + 0.5) - positionAt;
positionAt = (RotatedBy(float2(sin(uTime * 1.7 + i / 4 * 6.283), sin(uTime * 1.9 + i / 4 * 6.283)), uTime + i / 4 * 6.283) * 0.5 + 0.5) - positionAt;
float dist = distance(coords, positionAt);
if (dist < 0.35)
{
@@ -52,12 +52,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
returnColor = lerp(returnColor, uSecondaryColor, (framedCoords.y - 0.5) * 3);
}
return float4(returnColor, 1) * color * brightness;
return float4(returnColor, 1) * color * sampleColor * brightness;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+3 -3
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
@@ -42,12 +42,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
// Use a specialized blend method to create the shine effect.
color.rgb = (length(color.rgb) <= 0.5) ? 2 * color.rgb * goldColor : 1 - 2 * (1 - color.rgb) * (1 - goldColor);
return (color + noiseColor * 0.45) * color.a;
return (color + noiseColor * 0.45) * sampleColor * color.a;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 pixelBelow = tex2D(uImage0, coords);
@@ -41,7 +41,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
// Handle red fades based on noise.
color = lerp(color, float4(1, 0, 0, 1), pow(noiseColor.r, 3) * 0.3 + verticalFlowMovement * 0.3 + 0.16) * color.a;
return color * (1 + (1 - outlineFade) * 0.25);
return color * (1 + (1 - outlineFade) * 0.25) * sampleColor;
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
@@ -36,7 +36,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
float3 flameColor = lerp(alteredColor, alteredSecondaryColor, fadeToRed);
flameColor.r = 0.6 + sqrt(fadeToRed) * 0.4;
color = lerp(color, float4(flameColor, 1), 0.45) * color.a;
return color * lerp(1.3, 5.4, pow(flameStreakBrightness, 4.44));
return color * lerp(1.3, 5.4, pow(flameStreakBrightness, 4.44)) * sampleColor;
}
technique Technique1
{
Binary file not shown.
+3 -3
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 noiseColor = tex2D(uImage1, framedCoords);
@@ -40,12 +40,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
blendFactor *= framedCoords.y / 0.2;
}
float4 colorBlendMultiplier = lerp(float4(blendColor, 1), float4(1, 1, 1, 1), saturate(pow(blendFactor * 1.5, 2)));
return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness);
return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness) * sampleColor;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+2 -2
View File
@@ -27,14 +27,14 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
coords.x += randomness(uTime + framedCoords.y).x * (1 - framedCoords.y) * 6 / uImageSize0.x; // Add an X offset based on a noise function, giving a moon lord void-esque shader effect.
float4 color = tex2D(uImage0, coords);
float4 returnColor = color * 0.1;
returnColor.a = color.a;
return returnColor;
return returnColor * sampleColor;
}
technique Technique1
{
Binary file not shown.
+3 -3
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float2 swirlOffset = float2(sin(uTime * 0.26 + 1.754) * 0.31, sin(uTime * 0.26) * 0.16) * uSaturation;
@@ -46,12 +46,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
// And create stars based on a noise texture that rise upward.
color = lerp(color, float4(starColor, 1) * color.a, fadeToNormal * pow(brightnessFactor, 6) * 0.15);
return color * (1 + brightnessFactor);
return color * (1 + brightnessFactor) * sampleColor;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
@@ -35,7 +35,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
baseColor *= 1 + pow(baseColor, 5).r * 8 - noiseColor2.r * 1.25;
baseColor = lerp(baseColor, uSecondaryColor * 2, pow(noiseColor.r, 2));
return float4(baseColor, 1) * opacity;
return float4(baseColor, 1) * sampleColor * opacity;
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 noiseColor = tex2D(uImage1, float2(frac(framedCoords.x + uTime * 0.1), framedCoords.y));
@@ -39,7 +39,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
if (normalizedDistanceFromCenter > 0.7)
fadeToSecondaryColor *= saturate(1 - (normalizedDistanceFromCenter - 0.7) / 0.2);
float4 endFadeColor = lerp(float4(uColor, 1), float4(uSecondaryColor, 1), 0.5);
return (lerp(color, endFadeColor, 0.3 + fadeToSecondaryColor * 0.6) * color.a) * (1 + brightness);
return (lerp(color, endFadeColor, 0.3 + fadeToSecondaryColor * 0.6) * color.a) * sampleColor * (1 + brightness);
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -25,7 +25,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
@@ -40,7 +40,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
colorMap.rgb *= brightness;
colorMap.rgb = colorMap.rgb - colorMap.rgb % Variance; // Slice the return color map to make pixels appear less varied and more extreme
return colorMap * color;
return colorMap * color * sampleColor * sampleColor.a;
}
technique Technique1
{
Binary file not shown.
+4 -4
View File
@@ -29,20 +29,20 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
float interval = (cos(framedCoords.x * 6.283 + uTime * 3.141) * 2 + sin(uTime * 7 + framedCoords.y * 6)) * 0.125 + 0.5;
float interval = (sin(framedCoords.x * 6.283 + uTime * 3.141) * 2 + sin(uTime * 7 + framedCoords.y * 6)) * 0.125 + 0.5;
interval *= 2; // Exaggerate the interval.
float4 returnColor = float4(lerp(colors[floor(interval) % 4], colors[floor(interval + 1) % 4], interval % 1), 1); // But clamp it to a 0-1 range.
return returnColor * color * 1.95;
return returnColor * color * sampleColor * 1.95;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+4 -4
View File
@@ -21,11 +21,11 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
float time = (sin(uTime + framedCoords.x * cos(uTime + 3.141 * framedCoords.x) + 1.5707 * framedCoords.y) * 0.5 + 0.5) * 6;
float time = (sin(uTime + framedCoords.x * sin(uTime + 3.141 * framedCoords.x) + 1.5707 * framedCoords.y) * 0.5 + 0.5) * 6;
float timeFloored = floor(time);
float3 colors[6] =
@@ -40,12 +40,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
// Use a multi-lerp to fade between colors and then base them on a trig-based time step.
color.rgb *= lerp(colors[timeFloored] / 255.0, colors[(timeFloored + 1) % 6] / 255.0, time / 6) * 1.6;
return color;
return color * sampleColor;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
@@ -30,7 +30,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
float4 color = tex2D(uImage0, coords);
float luminosity = (color.r + color.g + color.b) / 3;
color.rgb = luminosity * idealColor * 1.3; // Average out the colors.
return color;
return color * sampleColor;
}
technique Technique1
{
Binary file not shown.
+3 -3
View File
@@ -56,7 +56,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 noiseColor = tex2D(uImage1, float2(framedCoords.x, framedCoords.y - uTime * 0.45) * 0.1);
@@ -66,12 +66,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
float brightness = (blendFactor * 0.4 + noiseColor.r * 0.9) * 1.2;
float4 colorBlendMultiplier = lerp(float4(blendColor, 1), float4(1, 1, 1, 1), saturate(blendFactor * 1.5));
return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness);
return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * sampleColor * colorBlendMultiplier * (1 + brightness);
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float3 idealColor = uColor;
@@ -33,7 +33,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
float4 color = tex2D(uImage0, coords);
float luminosity = (color.r + color.g + color.b) / 3;
color.rgb = luminosity * idealColor * 1.6; // Average out the colors.
return color;
return color * sampleColor;
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 noiseColor = tex2D(uImage1, float2(framedCoords.x, frac(framedCoords.y + uTime * 0.7)));
@@ -39,7 +39,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
float4 blendedColor = (color + endFadeColor) * 0.5 - 0.05;
blendedColor *= 1.4;
blendedColor.a = 1;
return blendedColor * color.a * (1 + lerp(0.07, 0.3, fadeToSecondaryColor) + noiseColor.g * 0.1);
return blendedColor * color.a * (1 + lerp(0.07, 0.3, fadeToSecondaryColor) + noiseColor.g * 0.1) * sampleColor;
}
technique Technique1
{
Binary file not shown.
+3 -3
View File
@@ -21,13 +21,13 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
// Read the fade map as a streak.
float4 fadeMapColor = tex2D(uImage1, float2(frac(framedCoords.x * 0.18 + cos(uTime * 0.9) * 0.021), frac(framedCoords.y * 0.32 + uTime * 0.2)));
float4 fadeMapColor = tex2D(uImage1, float2(frac(framedCoords.x * 0.18 + sin(uTime * 0.9) * 0.021), frac(framedCoords.y * 0.32 + uTime * 0.2)));
fadeMapColor.r *= pow(framedCoords.x, 0.2);
float opacity = lerp(1.05, 1.95, fadeMapColor.r);
@@ -41,7 +41,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
transformColor = lerp(transformColor, float3(206 / 255, 116 / 255, 59 / 255), orangeFade);
color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r);
opacity *= color.a;
return color * opacity;
return color * sampleColor * opacity;
}
technique Technique1
{
Binary file not shown.
+1 -1
View File
@@ -20,7 +20,7 @@ float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD
{
float4 returnColor = tex2D(uImage0, coords);
returnColor.rgb *= uColor * max(1, (sin(uTime) * 0.5 + 0.5) * 0.3 + 1.3);
return returnColor;
return returnColor * sampleColor;
}
technique Technique1
{
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
@@ -30,7 +30,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
color.rgb *= ((framedCoords.x * uColor * (1 - yMultiplier) * 1.4) + ((1 - framedCoords.x) * uSecondaryColor * yMultiplier * 1.7)) * luminosity * 2.1;
color.rgb *= clamp(1.6 * saturate(distance((0.5, 0.5), framedCoords)), 0.8, 1.6); // Intensify the colors based on how far they are from the center of the sprite.
return color;
return color * sampleColor;
}
technique Technique1
{
Binary file not shown.
+5 -5
View File
@@ -18,14 +18,14 @@ float2 uLegacyArmorSheetSize;
float2 RotatedBy(float theta, float x, float y)
{
return float2(x * cos(theta) + y * sin(theta), x * sin(theta) - y * cos(theta));
return float2(x * sin(theta + 1.57) + y * sin(theta), x * sin(theta) - y * sin(theta + 1.57));
}
float2 InverseLerp(float2 start, float2 end, float2 x)
{
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float sineTime = sin(uTime); // Saved so that I don't have the compute this multiple times. Shaders have a limited number of mathematical instructions you can use - 64.
@@ -35,7 +35,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
modifiedCoords = RotatedBy(uTime + 0.4 * sineTime, modifiedCoords.y, modifiedCoords.x);
float4 noiseColor = tex2D(uImage1, modifiedCoords);
float xMultiplier = cos(framedCoords.x * 2.3 + uTime) + 1;
float xMultiplier = sin(framedCoords.x * 2.3 + uTime + 1.57) + 1;
float yMultiplier = sin(framedCoords.y * 2 + uTime * 1.4) + 1;
float interpolationValue = saturate(xMultiplier * yMultiplier) * 0.7 + 0.3; // Range of 0-1. Depends on the current coordinates and the time.
@@ -43,12 +43,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
color.rgb *= 0.2 + pow(noiseColor.rgb, 3); // Squash the color to the upper and lower bounds and add a bit of lightness to it.
color.rgb *= lerp(uColor, uSecondaryColor, interpolationValue); // Blend with the secondary color.
color.rgb *= 1.7 + (sineTime * 0.5 + 1.5) * interpolationValue; // Range of 1.7 to 3.7, can cause certain spots to become very bright.
return color;
return color * sampleColor;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+2 -2
View File
@@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
@@ -42,7 +42,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
// Handle sludge fades based on noise.
color = lerp(color, float4(uSecondaryColor * 0.375, 1), pow(noiseColor.r, 3) * 0.3 + verticalFlowMovement * 0.3 + 0.13) * color.a;
return color * (1 + (1 - outlineFade) * 0.1);
return color * sampleColor * (1 + (1 - outlineFade) * 0.1);
}
technique Technique1
{
Binary file not shown.
+4 -4
View File
@@ -22,17 +22,17 @@ float2 InverseLerp(float2 start, float2 end, float2 x)
return saturate((x - start) / (end - start));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw;
float4 color = tex2D(uImage0, coords);
float sineTime = sin(uTime); // Saved so that I don't have the compute this multiple times. Shaders have a limited number of mathematical instructions you can use - 64.
float2 modifiedCoords = coords;
modifiedCoords.x += cos(uTime + framedCoords.y) * 0.5 + 0.5; // Cause the effect to sway around a bit with time.
modifiedCoords.x += sin(uTime + framedCoords.y + 1.57) * 0.5 + 0.5; // Cause the effect to sway around a bit with time.
float4 noiseColor = tex2D(uImage1, frac(modifiedCoords));
float xMultiplier = cos(framedCoords.x * 2.3 + uTime * 1.15) + 0.5;
float xMultiplier = sin(framedCoords.x * 2.3 + uTime * 1.15 + 1.57) + 0.5;
float yMultiplier = (sin(framedCoords.y * 2 + uTime * 1.4) + 1) * 0.5;
color.rgb *= lerp(uColor, uSecondaryColor, saturate(xMultiplier * yMultiplier * 1.6));
@@ -41,7 +41,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO
color.rgb *= 1.6; // Sometimes give light "patches" depending on the swaying noise image.
}
color.rgb *= 1.6; // Brighten the shader over time.
return color;
return color * sampleColor;
}
technique Technique1
{
Binary file not shown.
+3 -3
View File
@@ -20,12 +20,12 @@ float4 uShaderSpecificData;
float2 RotatedBy(float2 xy, float theta)
{
return float2(xy.x * cos(theta) + xy.y * sin(theta), xy.x * sin(theta) - xy.y * cos(theta));
return float2(xy.x * sin(theta + 1.57) - xy.y * sin(theta), xy.x * sin(theta) + xy.y * sin(theta + 1.57));
}
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
float2 worldPos = uWorldPosition + RotatedBy(coords - 0.5, uRotation - 1.57) * uSize;
if (sign(dot(uIntersectionNormal, worldPos - uIntersectionPosition)) == uIntersectionCutoffDirection)
float2 worldPos = uWorldPosition + RotatedBy(coords - 0.5, uRotation) * uSize;
if (sign(dot(uIntersectionNormal, normalize(worldPos - uIntersectionPosition))) == uIntersectionCutoffDirection)
return 0;
return tex2D(uImage0, coords) * sampleColor;
Binary file not shown.
+2 -2
View File
@@ -161,11 +161,11 @@ namespace CalamityMod.Projectiles.Melee.Spears
{
Main.spriteBatch.EnterShaderRegion();
Vector2 intersectionNormal = portalDrawPosition + Main.screenPosition - Projectile.Center;
Vector2 worldOffset = Projectile.rotation.ToRotationVector2() * -45f;
Vector2 worldOffset = Projectile.rotation.ToRotationVector2() * Utils.GetLerpValue(0f, StreamGouge.SpearFireTime, Time - StreamGouge.SpinTime, true) * 80f;
Vector2 intersectionOffset = (portalDrawPosition + Main.screenPosition - Projectile.Center) * -1.5f;
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionPosition"].SetValue(portalDrawPosition + intersectionOffset);
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionNormal"].SetValue(intersectionNormal);
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionCutoffDirection"].SetValue(-1f);
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionCutoffDirection"].SetValue(1f);
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uWorldPosition"].SetValue(Projectile.Center - Main.screenPosition + worldOffset);
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uSize"].SetValue(texture.Size());
GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uRotation"].SetValue(Projectile.rotation);