Compositor: Alpha Mode

{D9211} introduced pre-multiplying the color for the keying node. This
pre-multiplication should also be done by other keying nodes and should be
the default operation for alpha node.

This patch will change the logic of keying nodes (Cryptomatte Node,
Channel Matte, Chroma Matte, Color Matte, Difference Matte, Distance
Matte, Luminance Matte) and breaks old files.

The Set alpha node has a mode parameter. This parameter changes
the logic to `Apply Mask` the alpha on the RGBA channels of the input color
or only replace the alpha channel (old behavior).

The replace mode is automatically set for older files. When adding
new files the the multiply mode is set.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D9630
This commit is contained in:
2021-01-05 16:16:18 +01:00
parent 357e519575
commit 9dbea1db66
25 changed files with 147 additions and 63 deletions

View File

@@ -111,10 +111,10 @@ void ChannelMatteOperation::executePixelSampled(float output[4],
alpha = (alpha - limit_min) / limit_range;
}
/* store matte(alpha) value in [0] to go with
* COM_SetAlphaOperation and the Value output
/* Store matte(alpha) value in [0] to go with
* COM_SetAlphaMultiplyOperation and the Value output.
*/
/* don't make something that was more transparent less transparent */
/* Don't make something that was more transparent less transparent. */
output[0] = min(alpha, inColor[3]);
}