[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36370] branches/cycles: Cycles: fix for vector math node by Lukas Toenne, thanks.
Brecht Van Lommel
brechtvanlommel at pandora.be
Thu Apr 28 13:45:07 CEST 2011
Revision: 36370
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36370
Author: blendix
Date: 2011-04-28 11:45:06 +0000 (Thu, 28 Apr 2011)
Log Message:
-----------
Cycles: fix for vector math node by Lukas Toenne, thanks.
Modified Paths:
--------------
branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl
branches/cycles/intern/cycles/render/nodes.cpp
branches/cycles/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
Modified: branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl
===================================================================
--- branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl 2011-04-28 09:52:16 UTC (rev 36369)
+++ branches/cycles/intern/cycles/kernel/osl/nodes/node_vector_math.osl 2011-04-28 11:45:06 UTC (rev 36370)
@@ -22,31 +22,31 @@
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);
}
}
Modified: branches/cycles/intern/cycles/render/nodes.cpp
===================================================================
--- branches/cycles/intern/cycles/render/nodes.cpp 2011-04-28 09:52:16 UTC (rev 36369)
+++ branches/cycles/intern/cycles/render/nodes.cpp 2011-04-28 11:45:06 UTC (rev 36370)
@@ -1838,7 +1838,7 @@
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 @@
{
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)
Modified: branches/cycles/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
===================================================================
--- branches/cycles/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c 2011-04-28 09:52:16 UTC (rev 36369)
+++ branches/cycles/source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c 2011-04-28 11:45:06 UTC (rev 36370)
@@ -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, "" }
};
More information about the Bf-blender-cvs
mailing list