diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_IDMaskOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_IDMaskOperation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_IDMaskOperation.cpp b/source/blender/compositor/operations/COM_IDMaskOperation.cpp index a021f07d2a7..68e681c1326 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; } |