From b2f0060558d75efa222a73453f4d13ac36c0cf76 Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Mon, 16 Sep 2024 01:10:36 +0200 Subject: [PATCH] Cleanup! --- source/funkin/backend/shaders/FunkinShader.hx | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/source/funkin/backend/shaders/FunkinShader.hx b/source/funkin/backend/shaders/FunkinShader.hx index 451afecd..b9ef4658 100644 --- a/source/funkin/backend/shaders/FunkinShader.hx +++ b/source/funkin/backend/shaders/FunkinShader.hx @@ -440,25 +440,7 @@ uniform bool hasColorTransform; vec4 flixel_texture2D(sampler2D bitmap, vec2 coord) { vec4 color = texture2D(bitmap, coord); - if (!hasTransform) { - return color; - } - - if (color.a == 0.0) { - return vec4(0.0, 0.0, 0.0, 0.0); - } - - if (!hasColorTransform) { - return color * openfl_Alphav; - } - - color = vec4(color.rgb / color.a, color.a); - color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0); - - if (color.a > 0.0) { - return vec4(color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav); - } - return vec4(0.0, 0.0, 0.0, 0.0); + return applyFlixelEffects(color); } vec4 applyFlixelEffects(vec4 color) { @@ -474,7 +456,7 @@ vec4 applyFlixelEffects(vec4 color) { return color * openfl_Alphav; } - color = vec4(color.rgb / color.a, color.a); + color.rgb = color.rgb / color.a; color = clamp(openfl_ColorOffsetv + (color * openfl_ColorMultiplierv), 0.0, 1.0); if (color.a > 0.0) {