app: improve vivid-light formula

This commit is contained in:
Øyvind Kolås
2017-01-23 22:39:42 +01:00
parent 2762662ca9
commit 5978def585

View File

@ -1150,12 +1150,13 @@ blendfun_vivid_light (const float *dest,
if (src[c] > 0.5f)
{
comp = (1.0f - (1.0f - dest[c]) / (2.0f * (src[c] - 0.5f)));
comp = (1.0f - (1.0f - dest[c]) / (2.0f * (src[c])));
}
else
{
comp = dest[c] / (1.0f - 2.0f * src[c]);
comp = dest[c] / (1.0f - 2.0f * (src[c] - 0.5));
}
comp = MIN (comp, 1.0f);
out[c] = comp;
}