From e1e1cd3dd309e370a934ada65f7a8219123fc8b3 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Wed, 17 Aug 2022 10:35:34 +0200 Subject: [PATCH] Implement missing blend modes --- js/texturing/painter.js | 13 ++++++------- lang/en.json | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/texturing/painter.js b/js/texturing/painter.js index bcc21ad2..23a86e92 100644 --- a/js/texturing/painter.js +++ b/js/texturing/painter.js @@ -1054,15 +1054,15 @@ const Painter = { // Todo: Equations for remaining blend modes case 'screen': - mix[ch] = ((normal_base / normal_added) * added.a) + (normal_base * (1-added.a)); + mix[ch] = ((1 - ((1-normal_base) * (1-normal_added))) * added.a) + (normal_base * (1-added.a)); break; - case 'hard_light': - mix[ch] = ((normal_base / normal_added) * added.a) + (normal_base * (1-added.a)); - break; + //case 'hard_light': + //mix[ch] = ((normal_base / normal_added) * added.a) + (normal_base * (1-added.a)); + //break; case 'difference': - mix[ch] = ((normal_base - normal_added) * added.a) + (normal_base * (1-added.a)); + mix[ch] = ((1-normal_base) * added.a * normal_added) + (normal_base * (1-(added.a*normal_added))); break; } @@ -1683,8 +1683,7 @@ BARS.defineActions(function() { divide: true, add: true, subtract: true, - overlay: true, - hard_light: true, + screen: true, difference: true, } }) diff --git a/lang/en.json b/lang/en.json index 954de8d0..eeca5bd6 100644 --- a/lang/en.json +++ b/lang/en.json @@ -901,6 +901,7 @@ "action.blend_mode.divide": "Divide", "action.blend_mode.add": "Add", "action.blend_mode.subtract": "Subtract", + "action.blend_mode.screen": "Screen", "action.blend_mode.overlay": "Overlay", "action.blend_mode.hard_light": "Hard Light", "action.blend_mode.difference": "Difference",