[Bf-blender-cvs] [6785a2bd66f] master: Fix T53371: Keying Node fails with values above 1

Sergey Sharybin noreply at git.blender.org
Tue Nov 21 17:35:17 CET 2017


Commit: 6785a2bd66f7f1c55098e4c71baa68ce3cc2bbf9
Author: Sergey Sharybin
Date:   Tue Nov 21 17:31:45 2017 +0100
Branches: master
https://developer.blender.org/rB6785a2bd66f7f1c55098e4c71baa68ce3cc2bbf9

Fix T53371: Keying Node fails with values above 1

This was expected behavior for over-exposured lamps when the mode was originally
created for Tears of Steel. Turns out, there could be really bad green screen in
real production which will only have green (or rather screen) channel over
exposured.

Tweaked condition now so we use least bright channel to see if the area has
proper exposure or not.

Seems to work fine in tests, but further tweaks are possible.

===================================================================

M	source/blender/compositor/operations/COM_KeyingOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp
index e2566d2f4f0..873a537efe3 100644
--- a/source/blender/compositor/operations/COM_KeyingOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp
@@ -74,8 +74,9 @@ void KeyingOperation::executePixelSampled(float output[4], float x, float y, Pix
 	this->m_screenReader->readSampled(screenColor, x, y, sampler);
 
 	const int primary_channel = max_axis_v3(screenColor);
+	const float min_pixel_color = min_fff(pixelColor[0], pixelColor[1], pixelColor[2]);
 
-	if (pixelColor[primary_channel] > 1.0f) {
+	if (min_pixel_color > 1.0f) {
 		/* overexposure doesn't happen on screen itself and usually happens
 		 * on light sources in the shot, this need to be checked separately
 		 * because saturation and falloff calculation is based on the fact



More information about the Bf-blender-cvs mailing list