Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-10-21 18:56:09 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-10-21 18:58:37 +0300
commitfd4caafc53a1c2558f1a27eeaecffb130a146ff4 (patch)
tree9b18af960701d9292238f46955da6ded2e9847ff /source/blender/compositor
parentb51874437d86a84684ed3327874285520cb886f4 (diff)
Fix T49789: Compositor mix node interpolation bug
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cpp b/source/blender/compositor/operations/COM_TextureOperation.cpp
index 665bffc2c1c..bba5c8702b8 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cpp
+++ b/source/blender/compositor/operations/COM_TextureOperation.cpp
@@ -110,8 +110,18 @@ void TextureBaseOperation::executePixelSampled(float output[4], float x, float y
int retval;
const float cx = this->getWidth() / 2;
const float cy = this->getHeight() / 2;
- const float u = (x - cx) / this->getWidth() * 2;
- const float v = (y - cy) / this->getHeight() * 2;
+ float u = (x - cx) / this->getWidth() * 2;
+ float v = (y - cy) / this->getHeight() * 2;
+
+ /* When no interpolation/filtering happens in multitex() foce nearest interpolation.
+ * We do it here because (a) we can't easily say multitex() that we want nearest
+ * interpolaiton and (b) in such configuration multitex() sinply floor's the value
+ * which often produces artifacts.
+ */
+ if ((m_texture->imaflag & TEX_INTERPOL) == 0) {
+ u += 0.5f / cx;
+ v += 0.5f / cy;
+ }
this->m_inputSize->readSampled(textureSize, x, y, sampler);
this->m_inputOffset->readSampled(textureOffset, x, y, sampler);