Commit e69924b4 authored by Alexandre Prokoudine's avatar Alexandre Prokoudine
Browse files

Fix the linear light layer mode formula

This simpler version provides the rendering that matches
Photoshop's one.
parent 7a000a09
...@@ -1766,7 +1766,7 @@ blendfun_vivid_light (const float *dest, ...@@ -1766,7 +1766,7 @@ blendfun_vivid_light (const float *dest,
/* added according to: /* added according to:
http://www.deepskycolors.com/archivo/2010/04/21/formulas-for-Photoshop-blending-modes.html */ http://www.simplefilter.de/en/basics/mixmods.html */
static inline void static inline void
blendfun_linear_light (const float *dest, blendfun_linear_light (const float *dest,
const float *src, const float *src,
...@@ -1782,14 +1782,7 @@ blendfun_linear_light (const float *dest, ...@@ -1782,14 +1782,7 @@ blendfun_linear_light (const float *dest,
for (c = 0; c < 3; c++) for (c = 0; c < 3; c++)
{ {
gfloat comp; gfloat comp;
if (src[c] > 0.5f) comp = dest[c] + 2.0f * src[c] - 1.0f;
{
comp = dest[c] + 2.0 * (src[c] - 0.5);
}
else
{
comp = dest[c] + 2.0 * src[c] - 1.0;
}
out[c] = comp; out[c] = comp;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment