diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-16 12:08:37 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-16 12:08:37 +0400 |
commit | 25b25059efd774cf119ac62dfdbd39a314f07b00 (patch) | |
tree | 9426df91f73c5e81cd4676ccd3af8cecaa2941c2 | |
parent | 233f27a7e17c71d89efbcdf49f744639b20fc613 (diff) |
Cycles: fix vector math subtract not working correct, patch by Sanne.
-rw-r--r-- | intern/cycles/kernel/osl/nodes/node_vector_math.osl | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_math.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_vector_math.osl b/intern/cycles/kernel/osl/nodes/node_vector_math.osl index 302351372c2..9e0f0b60522 100644 --- a/intern/cycles/kernel/osl/nodes/node_vector_math.osl +++ b/intern/cycles/kernel/osl/nodes/node_vector_math.osl @@ -30,7 +30,7 @@ shader node_vector_math( 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") { diff --git a/intern/cycles/kernel/svm/svm_math.h b/intern/cycles/kernel/svm/svm_math.h index 6650a10a4d9..401bd22b45a 100644 --- a/intern/cycles/kernel/svm/svm_math.h +++ b/intern/cycles/kernel/svm/svm_math.h @@ -121,7 +121,7 @@ __device void svm_vector_math(float *Fac, float3 *Vector, NodeVectorMath type, f *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) { |