diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-08 17:56:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-08 17:56:50 +0300 |
commit | 817e975dee27640947bf7d083db39d1d70120385 (patch) | |
tree | 94167799c244b6e368a9b944f5ce883d69a095f4 /source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp | |
parent | 97c4c2689fda8d1da8c98612b10dd6212764f067 (diff) |
Fix T50849: Transparent background produces artifacts in this compositing setup
The issue was caused by sometimes negative color returned by the filter node.
Seems to be caused by precision issues. Don't see any reason why we would want
negative colors in output. Those only causing issues later on.
Diffstat (limited to 'source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp index e1ada9a8c39..5f78067220a 100644 --- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp @@ -94,4 +94,10 @@ void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y, output[2] = output[2] * value[0] + in2[2] * mval; output[3] = in2[3]; + + /* Make sure we don't return negative color. */ + output[0] = max(output[0], 0.0f); + output[1] = max(output[1], 0.0f); + output[2] = max(output[2], 0.0f); + output[3] = max(output[3], 0.0f); } |