diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-16 14:13:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-16 14:13:04 +0400 |
commit | add9aea57391a6c496a0541d97ef870c442adc81 (patch) | |
tree | d5d9c4951a28f61a3b1c185e6049d38379af3bfa /source/blender/compositor/intern | |
parent | 121fd266b0ed4865dc995448985e1725fc42b3c8 (diff) |
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.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.cpp | 7 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.h | 2 | ||||
-rw-r--r-- | source/blender/compositor/intern/COM_SocketReader.h | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 3b8fbd6d708..d227f9cc4bb 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -259,7 +259,10 @@ float clipuv(float x, float limit) return x; } -void MemoryBuffer::readEWA(float result[4], float fx, float fy, float dx, float dy) +/** + * \note \a sampler at the moment is either 'COM_PS_NEAREST' or not, other values won't matter. + */ +void MemoryBuffer::readEWA(float result[4], float fx, float fy, float dx, float dy, PixelSampler sampler) { const int width = this->getWidth(), height = this->getHeight(); @@ -280,7 +283,7 @@ void MemoryBuffer::readEWA(float result[4], float fx, float fy, float dx, float // Use a different radius based on interpolation switch, just enough to anti-alias when interpolation is off, // and slightly larger to make result a bit smoother than bilinear interpolation when interpolation is on // (minimum values: const float rmin = intpol ? 1.f : 0.5f;) - const float rmin = 1.5625f / ff2; + const float rmin = ((sampler != COM_PS_NEAREST) ? 1.5625f : 0.765625f) / ff2; imp2radangle(A, B, C, F, &a, &b, &th, &ecc); if ((b2 = b * b) < rmin) { if ((a2 = a * a) < rmin) { diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 5d0d9c97450..d176298578f 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -202,7 +202,7 @@ public: - void readEWA(float result[4], float fx, float fy, float dx, float dy); + void readEWA(float result[4], float fx, float fy, float dx, float dy, PixelSampler sampler); /** * @brief is this MemoryBuffer a temporarily buffer (based on an area, not on a chunk) diff --git a/source/blender/compositor/intern/COM_SocketReader.h b/source/blender/compositor/intern/COM_SocketReader.h index 279ca8ebdb8..01e1403b021 100644 --- a/source/blender/compositor/intern/COM_SocketReader.h +++ b/source/blender/compositor/intern/COM_SocketReader.h @@ -88,7 +88,7 @@ protected: * @param dy * @param inputBuffers chunks that can be read by their ReadBufferOperation. */ - virtual void executePixel(float output[4], float x, float y, float dx, float dy) {} + virtual void executePixel(float output[4], float x, float y, float dx, float dy, PixelSampler sampler) {} public: inline void read(float *result, float x, float y, PixelSampler sampler) { @@ -97,8 +97,8 @@ public: inline void read(float *result, int x, int y, void *chunkData) { executePixel(result, x, y, chunkData); } - inline void read(float *result, float x, float y, float dx, float dy) { - executePixel(result, x, y, dx, dy); + inline void read(float *result, float x, float y, float dx, float dy, PixelSampler sampler) { + executePixel(result, x, y, dx, dy, sampler); } virtual void *initializeTileData(rcti *rect) { return 0; } |