[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52303] trunk/blender/source/blender/ blenlib/intern/math_interp.c: Fix #33210: Diffuse Pass in scale node leads to problems

Sergey Sharybin sergey.vfx at gmail.com
Sat Nov 17 14:38:45 CET 2012


Revision: 52303
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52303
Author:   nazgul
Date:     2012-11-17 13:38:39 +0000 (Sat, 17 Nov 2012)
Log Message:
-----------
Fix #33210: Diffuse Pass in scale node leads to problems

Was own mistake in render layers interpolation changes.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/math_interp.c

Modified: trunk/blender/source/blender/blenlib/intern/math_interp.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_interp.c	2012-11-17 12:59:24 UTC (rev 52302)
+++ trunk/blender/source/blender/blenlib/intern/math_interp.c	2012-11-17 13:38:39 UTC (rev 52303)
@@ -134,12 +134,12 @@
 			w = wx * wy[m + 1];
 
 			if (float_output) {
-				const float *float_data = float_buffer + width * y1 * 4 + 4 * x1;
+				const float *float_data = float_buffer + width * y1 * components + components * x1;
 
 				vector_from_float(float_data, data, components);
 			}
 			else {
-				const unsigned char *byte_data = byte_buffer + width * y1 * 4 + 4 * x1;
+				const unsigned char *byte_data = byte_buffer + width * y1 * components + components * x1;
 
 				vector_from_byte(byte_data, data, components);
 			}
@@ -173,12 +173,12 @@
 				float data[4];
 
 				if (float_output) {
-					const float *float_data = float_buffer + width * y1 * 4 + 4 * x1;
+					const float *float_data = float_buffer + width * y1 * components + components * x1;
 
 					vector_from_float(float_data, data, components);
 				}
 				else {
-					const unsigned char *byte_data = byte_buffer + width * y1 * 4 + 4 * x1;
+					const unsigned char *byte_data = byte_buffer + width * y1 * components + components * x1;
 
 					vector_from_byte(byte_data, data, components);
 				}
@@ -270,16 +270,16 @@
 
 		/* sample including outside of edges of image */
 		if (x1 < 0 || y1 < 0) row1 = empty;
-		else row1 = float_buffer + width * y1 * 4 + 4 * x1;
+		else row1 = float_buffer + width * y1 * components + components * x1;
 
 		if (x1 < 0 || y2 > height - 1) row2 = empty;
-		else row2 = float_buffer + width * y2 * 4 + 4 * x1;
+		else row2 = float_buffer + width * y2 * components + components * x1;
 
 		if (x2 > width - 1 || y1 < 0) row3 = empty;
-		else row3 = float_buffer + width * y1 * 4 + 4 * x2;
+		else row3 = float_buffer + width * y1 * components + components * x2;
 
 		if (x2 > width - 1 || y2 > height - 1) row4 = empty;
-		else row4 = float_buffer + width * y2 * 4 + 4 * x2;
+		else row4 = float_buffer + width * y2 * components + components * x2;
 
 		a = u - floorf(u);
 		b = v - floorf(v);
@@ -306,16 +306,16 @@
 
 		/* sample including outside of edges of image */
 		if (x1 < 0 || y1 < 0) row1 = empty;
-		else row1 = byte_buffer + width * y1 * 4 + 4 * x1;
+		else row1 = byte_buffer + width * y1 * components + components * x1;
 
 		if (x1 < 0 || y2 > height - 1) row2 = empty;
-		else row2 = byte_buffer + width * y2 * 4 + 4 * x1;
+		else row2 = byte_buffer + width * y2 * components + components * x1;
 
 		if (x2 > width - 1 || y1 < 0) row3 = empty;
-		else row3 = byte_buffer + width * y1 * 4 + 4 * x2;
+		else row3 = byte_buffer + width * y1 * components + components * x2;
 
 		if (x2 > width - 1 || y2 > height - 1) row4 = empty;
-		else row4 = byte_buffer + width * y2 * 4 + 4 * x2;
+		else row4 = byte_buffer + width * y2 * components + components * x2;
 
 		a = u - floorf(u);
 		b = v - floorf(v);




More information about the Bf-blender-cvs mailing list