Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-04-28 15:45:06 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-04-28 15:45:06 +0400
commit791f6c94fbb593291b4eca46779736062ffe3927 (patch)
tree3b39795326690b57b87ffc8c295da0f601dff4c5
parent1484169c2f5b04eda9fa4a00fcdb84257718a6c1 (diff)
Cycles: fix for vector math node by Lukas Toenne, thanks.
-rw-r--r--intern/cycles/kernel/osl/nodes/node_vector_math.osl14
-rw-r--r--intern/cycles/render/nodes.cpp8
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c4
3 files changed, 13 insertions, 13 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_vector_math.osl b/intern/cycles/kernel/osl/nodes/node_vector_math.osl
index c6231d4350d..302351372c2 100644
--- a/intern/cycles/kernel/osl/nodes/node_vector_math.osl
+++ b/intern/cycles/kernel/osl/nodes/node_vector_math.osl
@@ -22,31 +22,31 @@ shader node_vector_math(
string type = "Add",
vector Vector1 = vector(0.0, 0.0, 0.0),
vector Vector2 = vector(0.0, 0.0, 0.0),
- output float Fac = 0.0,
+ output float Value = 0.0,
output vector Vector = vector(0.0, 0.0, 0.0))
{
if(type == "Add") {
Vector = Vector1 + Vector2;
- Fac = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2]))/3.0;
+ Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2]))/3.0;
}
if(type == "Subtract") {
Vector = Vector1 + Vector2;
- Fac = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2]))/3.0;
+ Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2]))/3.0;
}
if(type == "Average") {
- Fac = length(Vector1 + Vector2);
+ Value = length(Vector1 + Vector2);
Vector = normalize(Vector1 + Vector2);
}
if(type == "Dot Product") {
- Fac = dot(Vector1, Vector2);
+ Value = dot(Vector1, Vector2);
}
if(type == "Cross Product") {
vector c = cross(Vector1, Vector2);
- Fac = length(c);
+ Value = length(c);
Vector = normalize(c);
}
if(type == "Normalize") {
- Fac = length(Vector1);
+ Value = length(Vector1);
Vector = normalize(Vector1);
}
}
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index d783c3699ea..42cadb8faa7 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1838,7 +1838,7 @@ VectorMathNode::VectorMathNode()
add_input("Vector1", SHADER_SOCKET_VECTOR);
add_input("Vector2", SHADER_SOCKET_VECTOR);
- add_output("Fac", SHADER_SOCKET_FLOAT);
+ add_output("Value", SHADER_SOCKET_FLOAT);
add_output("Vector", SHADER_SOCKET_VECTOR);
}
@@ -1862,16 +1862,16 @@ void VectorMathNode::compile(SVMCompiler& compiler)
{
ShaderInput *vector1_in = input("Vector1");
ShaderInput *vector2_in = input("Vector2");
- ShaderOutput *fac_out = output("Fac");
+ ShaderOutput *value_out = output("Value");
ShaderOutput *vector_out = output("Vector");
compiler.stack_assign(vector1_in);
compiler.stack_assign(vector2_in);
- compiler.stack_assign(fac_out);
+ compiler.stack_assign(value_out);
compiler.stack_assign(vector_out);
compiler.add_node(NODE_VECTOR_MATH, type_enum[type], vector1_in->stack_offset, vector2_in->stack_offset);
- compiler.add_node(NODE_VECTOR_MATH, fac_out->stack_offset, vector_out->stack_offset);
+ compiler.add_node(NODE_VECTOR_MATH, value_out->stack_offset, vector_out->stack_offset);
}
void VectorMathNode::compile(OSLCompiler& compiler)
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
index 9979e488a71..a454e42336a 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
@@ -38,8 +38,8 @@
/* **************** VECTOR MATH ******************** */
static bNodeSocketType sh_node_vect_math_in[]= {
- { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f},
- { SOCK_VECTOR, 1, "Vector", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f},
+ { SOCK_VECTOR, 1, "Vector1", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f},
+ { SOCK_VECTOR, 1, "Vector2", 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 1.0f},
{ -1, 0, "" }
};