[Bf-blender-cvs] [8918e08] master: Fix T46408: Transform (bicubic) ID channel fails

Campbell Barton noreply at git.blender.org
Thu Oct 8 01:24:03 CEST 2015


Commit: 8918e089a5efed8aec0317ecad22efa68dabd6d3
Author: Campbell Barton
Date:   Thu Oct 8 10:16:54 2015 +1100
Branches: master
https://developer.blender.org/rB8918e089a5efed8aec0317ecad22efa68dabd6d3

Fix T46408: Transform (bicubic) ID channel fails

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

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

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

diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.cpp b/source/blender/compositor/operations/COM_IDMaskOperation.cpp
index a021f07..68e681c 100644
--- a/source/blender/compositor/operations/COM_IDMaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_IDMaskOperation.cpp
@@ -38,7 +38,9 @@ void IDMaskOperation::executePixelSampled(float output[4], float x, float y, Pix
 	float inputValue[4];
 	
 	this->m_inputProgram->readSampled(inputValue, x, y, sampler);
-	const float a = (inputValue[0] == this->m_objectIndex) ? 1.0f : 0.0f;
+	/* 'round' since sampling may adjust value slightly.
+	 * ID-mask input are originally integers too. */
+	const float a = (roundf(inputValue[0]) == this->m_objectIndex) ? 1.0f : 0.0f;
 	output[0] = a;
 }




More information about the Bf-blender-cvs mailing list