diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_MathBaseOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MathBaseOperation.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index 7039689aa5f..3749bcf42d8 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -317,4 +317,19 @@ void MathGreaterThanOperation::executePixel(float output[4], float x, float y, P clampIfNeeded(output); } +void MathModuloOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) +{ + float inputValue1[4]; + float inputValue2[4]; + + this->m_inputValue1Operation->read(&inputValue1[0], x, y, sampler); + this->m_inputValue2Operation->read(&inputValue2[0], x, y, sampler); + + if (inputValue2[0] == 0) + output[0] = 0.0; + else + output[0] = fmod(inputValue1[0], inputValue2[0]); + + clampIfNeeded(output); +} |