diff options
author | Szymon Ulatowski <szulat> | 2021-04-12 15:38:20 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-04-12 15:42:13 +0300 |
commit | 95e010a22eb422a1efa2f7e2bbb6b3ee168ce9e5 (patch) | |
tree | d836e368caef334e4984f46a4059888d5b3434a3 /source/blender/compositor/nodes/COM_GlareNode.cc | |
parent | 53f277a2e6b433c7ad4fa3ad54547842e5672a8d (diff) |
Fix T74680: Incorrect mixing in Glare node
The mixing function was designed to give correct results for Mix values of
-1, 0, and +1, but the behavior between these points was not linear. This is
unavoidable, because the function depends on both Mix and Mix^2 (by
multiplying value and mf) so they could not cancel out completely.
The new formula simply calculates the weighted sum without trying to invent
a smooth function.
Value for MixGlareOperation is now passed directly without scaling because
it is then easier to use.
Note that the previous formula performed max() twice for both input image
and the result, now there is just one max() per channel because the glare
input can't be negative.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D7138
Diffstat (limited to 'source/blender/compositor/nodes/COM_GlareNode.cc')
-rw-r--r-- | source/blender/compositor/nodes/COM_GlareNode.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/compositor/nodes/COM_GlareNode.cc b/source/blender/compositor/nodes/COM_GlareNode.cc index dbe9aaf73ed..0537074552a 100644 --- a/source/blender/compositor/nodes/COM_GlareNode.cc +++ b/source/blender/compositor/nodes/COM_GlareNode.cc @@ -63,7 +63,7 @@ void GlareNode::convertToOperations(NodeConverter &converter, thresholdOperation->setGlareSettings(glare); SetValueOperation *mixvalueoperation = new SetValueOperation(); - mixvalueoperation->setValue(0.5f + glare->mix * 0.5f); + mixvalueoperation->setValue(glare->mix); MixGlareOperation *mixoperation = new MixGlareOperation(); mixoperation->setResolutionInputSocketIndex(1); |