Added "lighten" and "darken" blend modes (resolves issue #443).

They perform the equations res.rgba = max(dst.rgba, src.rgba) and res.rgba = min(dst.rgba, src.rgba) respectively.

They only work when the "premultiplied" blend alpha mode is used, and an error occurs otherwise.  They also aren't supported on some non-iOS OpenGL ES 2 systems. Check for support with love.graphics.getSupported().lighten.
This commit is contained in:
Alex Szpakowski
2015-12-31 15:54:02 -04:00
parent 5a98af7e2d
commit b48117544d
3 changed files with 40 additions and 5 deletions
+3
View File
@@ -84,6 +84,8 @@ public:
BLEND_ADD,
BLEND_SUBTRACT,
BLEND_MULTIPLY,
BLEND_LIGHTEN,
BLEND_DARKEN,
BLEND_SCREEN,
BLEND_REPLACE,
BLEND_MAX_ENUM
@@ -138,6 +140,7 @@ public:
{
SUPPORT_MULTI_CANVAS_FORMATS,
SUPPORT_CLAMP_ZERO,
SUPPORT_LIGHTEN,
SUPPORT_MAX_ENUM
};