From d1871761d9420a2c8d0d2d747b209ec289f265bb Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 27 Aug 2021 13:55:18 -0400 Subject: [PATCH] blend lol --- source/shaderslmfao/OverlayBlend.hx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/shaderslmfao/OverlayBlend.hx b/source/shaderslmfao/OverlayBlend.hx index 78e03fb6d..cc77b5461 100644 --- a/source/shaderslmfao/OverlayBlend.hx +++ b/source/shaderslmfao/OverlayBlend.hx @@ -35,7 +35,11 @@ class OverlayBlend extends FlxShader vec4 blendOverlay(vec4 base, vec4 blend) { - return mix(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, step(base, vec4(0.5))); + vec4 mixed = mix(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, step(base, vec4(0.5))); + + // mixed = mix(mixed, blend, base.a); // proper alpha mixing + + return mixed; } void main() @@ -48,7 +52,7 @@ class OverlayBlend extends FlxShader vec4 gf = flixel_texture2D(funnyShit, openfl_TextureCoordv.xy + vec2(0.1, 0.2)); - vec4 mixedCol = blendOverlay(gf, color); + vec4 mixedCol = blendOverlay(color, gf); gl_FragColor = mixedCol; }