Minor change to sprite shader

This commit is contained in:
Flashfyre committed 2023-11-26 09:53:16 -05:00
1 parent ab9812f837
commit 1e2bd0dbb9
3 files changed
+9 -9

No files matched your search

+6 -6
View File
@@ -34,11 +34,6 @@ void main()
%forloop%
vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);
// Multiply texture tint
vec4 color = texture * texel;
for (int i = 0; i < 32; i++) {
if (spriteColors[i][3] == 0)
break;
@@ -48,11 +43,16 @@ void main()
float gray = (bg.r + bg.g + bg.b) / 3.0;
bg = vec3(gray, gray, gray);
vec3 fg = fusionColor;
color.rgb = mix(1.0 - 2.0 * (1.0 - bg) * (1.0 - fg), 2.0 * bg * fg, step(bg, vec3(0.5)));
texture.rgb = mix(1.0 - 2.0 * (1.0 - bg) * (1.0 - fg), 2.0 * bg * fg, step(bg, vec3(0.5)));
break;
}
}
vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);
// Multiply texture tint
vec4 color = texture * texel;
if (outTintEffect == 1.0) {
// Solid color + texture alpha
color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);