From add9aea57391a6c496a0541d97ef870c442adc81 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 16 Aug 2012 10:13:04 +0000 Subject: compositor - EWA filter was blurring too much by default, this caused the displace node to blur the image when no displacement was applied, making images fuzzy, the original C code has an interpolation option. Added this option back and use for displace and UV composite nodes. --- source/blender/compositor/operations/COM_DisplaceOperation.cpp | 4 ++-- source/blender/compositor/operations/COM_MapUVOperation.cpp | 2 +- source/blender/compositor/operations/COM_ReadBufferOperation.cpp | 4 ++-- source/blender/compositor/operations/COM_ReadBufferOperation.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/compositor/operations') diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp index 39f0ac7874b..31608c88274 100644 --- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp +++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp @@ -95,8 +95,8 @@ void DisplaceOperation::executePixel(float output[4], int x, int y, void *data) dxt = signf(dxt) * maxf(fabsf(dxt), DISPLACE_EPSILON) / this->getWidth(); dyt = signf(dyt) * maxf(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight(); - /* EWA filtering */ - this->m_inputColorProgram->read(output, u, v, dxt, dyt); + /* EWA filtering (without nearest it gets blurry with NO distortion) */ + this->m_inputColorProgram->read(output, u, v, dxt, dyt, COM_PS_NEAREST); } void DisplaceOperation::deinitExecution() diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp index 1a441b0ac9a..fe6ebcebf97 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.cpp +++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp @@ -107,7 +107,7 @@ void MapUVOperation::executePixel(float output[4], float x, float y, PixelSample u = inputUV[0] * this->m_inputColorProgram->getWidth(); v = inputUV[1] * this->m_inputColorProgram->getHeight(); - this->m_inputColorProgram->read(output, u, v, dx, dy); + this->m_inputColorProgram->read(output, u, v, dx, dy, COM_PS_NEAREST); /* "premul" */ if (alpha < 1.0f) { diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index a2385f79c04..03d41edda64 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -59,9 +59,9 @@ void ReadBufferOperation::executePixel(float output[4], float x, float y, PixelS } } -void ReadBufferOperation::executePixel(float output[4], float x, float y, float dx, float dy) +void ReadBufferOperation::executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) { - m_buffer->readEWA(output, x, y, dx, dy); + m_buffer->readEWA(output, x, y, dx, dy, sampler); } bool ReadBufferOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.h b/source/blender/compositor/operations/COM_ReadBufferOperation.h index 7958a4aee6b..7e3ac147ee3 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.h +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.h @@ -40,7 +40,7 @@ public: void *initializeTileData(rcti *rect); void executePixel(float output[4], float x, float y, PixelSampler sampler); - void executePixel(float output[4], float x, float y, float dx, float dy); + void executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler); const bool isReadBufferOperation() const { return true; } void setOffset(unsigned int offset) { this->m_offset = offset; } unsigned int getOffset() { return this->m_offset; } -- cgit v1.2.3