forked from bartvdbraak/blender
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.
This commit is contained in:
parent
97c4c2689f
commit
817e975dee
@ -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);
|
||||
}
|
||||
|
@ -107,6 +107,12 @@ void ConvolutionFilterOperation::executePixel(float output[4], int x, int y, voi
|
||||
output[1] = output[1] * value[0] + in2[1] * mval;
|
||||
output[2] = output[2] * value[0] + in2[2] * mval;
|
||||
output[3] = output[3] * value[0] + in2[3] * mval;
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
bool ConvolutionFilterOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
|
||||
|
Loading…
Reference in New Issue
Block a user