[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36712] branches/cycles/intern/cycles/ kernel: Cycles: fix vector math subtract not working correct, patch by Sanne.

Brecht Van Lommel brechtvanlommel at pandora.be
Mon May 16 10:08:37 CEST 2011


Revision: 36712
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36712
Author:   blendix
Date:     2011-05-16 08:08:37 +0000 (Mon, 16 May 2011)
Log Message:
-----------
Cycles: fix vector math subtract not working correct, patch by Sanne.

Modified Paths:
--------------
    branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl
    branches/cycles/intern/cycles/kernel/svm/svm_math.h

Modified: branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl	2011-05-16 07:55:12 UTC (rev 36711)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl	2011-05-16 08:08:37 UTC (rev 36712)
@@ -30,7 +30,7 @@
 		Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2]))/3.0;
 	}
 	if(type == "Subtract") {
-		Vector = Vector1 + Vector2;
+		Vector = Vector1 - Vector2;
 		Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2]))/3.0;
 	}
 	if(type == "Average") {

Modified: branches/cycles/intern/cycles/kernel/svm/svm_math.h
===================================================================
--- branches/cycles/intern/cycles/kernel/svm/svm_math.h	2011-05-16 07:55:12 UTC (rev 36711)
+++ branches/cycles/intern/cycles/kernel/svm/svm_math.h	2011-05-16 08:08:37 UTC (rev 36712)
@@ -121,7 +121,7 @@
 		*Fac = (fabsf(Vector->x) + fabsf(Vector->y) + fabsf(Vector->z))/3.0f;
 	}
 	else if(type == NODE_VECTOR_MATH_SUBTRACT) {
-		*Vector = Vector1 + Vector2;
+		*Vector = Vector1 - Vector2;
 		*Fac = (fabsf(Vector->x) + fabsf(Vector->y) + fabsf(Vector->z))/3.0f;
 	}
 	else if(type == NODE_VECTOR_MATH_AVERAGE) {




More information about the Bf-blender-cvs mailing list