mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Implement missing blend modes
This commit is contained in:
parent
fec0e78c0c
commit
e1e1cd3dd3
@ -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,
|
||||
}
|
||||
})
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user