[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59190] trunk/blender/source/blender/ compositor/operations: Tweaks to MapUV and PlaneTrack nodes to make results less doggy

Sergey Sharybin sergey.vfx at gmail.com
Fri Aug 16 15:58:35 CEST 2013


Revision: 59190
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59190
Author:   nazgul
Date:     2013-08-16 13:58:34 +0000 (Fri, 16 Aug 2013)
Log Message:
-----------
Tweaks to MapUV and PlaneTrack nodes to make results less doggy

This disables crazy adaptive sampling happening in diagonal direction.

This still gives some doggyness, but it's much less dramatic now,
and behavior is pretty damn the same as EWA filtering when rendering
textures with Blender Internal.

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_MapUVOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp

Modified: trunk/blender/source/blender/compositor/operations/COM_MapUVOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MapUVOperation.cpp	2013-08-16 13:55:33 UTC (rev 59189)
+++ trunk/blender/source/blender/compositor/operations/COM_MapUVOperation.cpp	2013-08-16 13:58:34 UTC (rev 59190)
@@ -71,6 +71,7 @@
 
 	dy = 0.5f * (uv_u + uv_d);
 
+#if 0
 	/* more adaptive sampling, red and green (UV) channels */
 	this->m_inputUVProgram->read(uv_a, x - 1, y - 1, COM_PS_NEAREST);
 	this->m_inputUVProgram->read(uv_b, x - 1, y + 1, COM_PS_NEAREST);
@@ -91,6 +92,7 @@
 
 	dx += 0.25f * (uv_l + uv_r);
 	dy += 0.25f * (uv_u + uv_d);
+#endif
 
 	/* UV to alpha threshold */
 	const float threshold = this->m_alpha * 0.05f;
@@ -98,11 +100,12 @@
 	if (alpha < 0.f) alpha = 0.f;
 	else alpha *= inputUV[2];
 
+#if 0
 	/* should use mipmap */
 	dx = min(dx, 0.2f);
 	dy = min(dy, 0.2f);
+#endif
 
-
 	/* EWA filtering */
 	u = inputUV[0] * this->m_inputColorProgram->getWidth();
 	v = inputUV[1] * this->m_inputColorProgram->getHeight();

Modified: trunk/blender/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp	2013-08-16 13:55:33 UTC (rev 59189)
+++ trunk/blender/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp	2013-08-16 13:58:34 UTC (rev 59190)
@@ -93,6 +93,7 @@
 
 	dy = 0.5f * (uv_u + uv_d);
 
+#if 0
 	/* more adaptive sampling, red and green (UV) channels */
 	ok1 = resolveUV(x - 1, y - 1, corners, uv_a);
 	ok2 = resolveUV(x - 1, y + 1, corners, uv_b);
@@ -117,6 +118,10 @@
 	/* should use mipmap */
 	*dx_r = min(dx, 0.2f);
 	*dy_r = min(dy, 0.2f);
+#else
+	*dx_r = dx;
+	*dy_r = dy;
+#endif
 
 	*u_r = inputUV[0];
 	*v_r = inputUV[1];
@@ -163,7 +168,7 @@
 			u *= this->m_pixelReader->getWidth();
 			v *= this->m_pixelReader->getHeight();
 
-			this->m_pixelReader->read(current_color, u, v, dx, dy, COM_PS_BICUBIC);
+			this->m_pixelReader->read(current_color, u, v, dx, dy, COM_PS_NEAREST);
 			premul_to_straight_v4(current_color);
 			add_v4_v4(color_accum, current_color);
 		}




More information about the Bf-blender-cvs mailing list