[Bf-blender-cvs] [7c2905b] master: Fix T44398: Compositing displace node makes image fuzzy with zero displacement

Sergey Sharybin noreply at git.blender.org
Tue May 12 14:26:17 CEST 2015


Commit: 7c2905b8ec6fb2a8f4929c1f0b631a8b9d391c03
Author: Sergey Sharybin
Date:   Tue May 12 17:24:07 2015 +0500
Branches: master
https://developer.blender.org/rB7c2905b8ec6fb2a8f4929c1f0b631a8b9d391c03

Fix T44398: Compositing displace node makes image fuzzy with zero displacement

EWA filtering with zero derivatives is introducing some fuzzyness into the
image. Currently solved by using regular sampling for cases when derivatives
are zero, which should also make compo faster in that areas.

Still need to look into checking if EWA filter can be tweaked in a way so
no fuzzyness is introduced.

===================================================================

M	source/blender/compositor/operations/COM_DisplaceOperation.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
index 643ecf9..e749157 100644
--- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp
+++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
@@ -55,9 +55,13 @@ void DisplaceOperation::executePixelSampled(float output[4], float x, float y, P
 	float uv[2], deriv[2][2];
 
 	pixelTransform(xy, uv, deriv);
-
-	/* EWA filtering (without nearest it gets blurry with NO distortion) */
-	this->m_inputColorProgram->readFiltered(output, uv[0], uv[1], deriv[0], deriv[1], COM_PS_BILINEAR);
+	if(is_zero_v2(deriv[0]) && is_zero_v2(deriv[1])) {
+		this->m_inputColorProgram->readSampled(output, uv[0], uv[1], COM_PS_BILINEAR);
+	}
+	else {
+		/* EWA filtering (without nearest it gets blurry with NO distortion) */
+		this->m_inputColorProgram->readFiltered(output, uv[0], uv[1], deriv[0], deriv[1], COM_PS_BILINEAR);
+	}
 }
 
 bool DisplaceOperation::read_displacement(float x, float y, float xscale, float yscale, const float origin[2], float &r_u, float &r_v)




More information about the Bf-blender-cvs mailing list