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:
authorThomas Dinges <blender@dingto.org>2013-03-10 04:42:47 +0400
committerThomas Dinges <blender@dingto.org>2013-03-10 04:42:47 +0400
commit56538ea685672fd882bbac81b0b4223dfaa3f7ce (patch)
tree31a2ebbbdb918b2d738c69775803cf5868e8b8ea /intern/cycles/kernel/shaders/node_vector_math.osl
parent5ac628fb477aaf2c2f0ee8ab5c25fb850a4c0a2a (diff)
Cycles / OSL:
* More small improvements: return immediately, and use "else if".
Diffstat (limited to 'intern/cycles/kernel/shaders/node_vector_math.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_vector_math.osl10
1 files changed, 5 insertions, 5 deletions
diff --git a/intern/cycles/kernel/shaders/node_vector_math.osl b/intern/cycles/kernel/shaders/node_vector_math.osl
index f22a6e8441a..4c94fc659c2 100644
--- a/intern/cycles/kernel/shaders/node_vector_math.osl
+++ b/intern/cycles/kernel/shaders/node_vector_math.osl
@@ -29,23 +29,23 @@ shader node_vector_math(
Vector = Vector1 + Vector2;
Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2])) / 3.0;
}
- if (type == "Subtract") {
+ else if (type == "Subtract") {
Vector = Vector1 - Vector2;
Value = (abs(Vector[0]) + abs(Vector[1]) + abs(Vector[2])) / 3.0;
}
- if (type == "Average") {
+ else if (type == "Average") {
Value = length(Vector1 + Vector2);
Vector = normalize(Vector1 + Vector2);
}
- if (type == "Dot Product") {
+ else if (type == "Dot Product") {
Value = dot(Vector1, Vector2);
}
- if (type == "Cross Product") {
+ else if (type == "Cross Product") {
vector c = cross(Vector1, Vector2);
Value = length(c);
Vector = normalize(c);
}
- if (type == "Normalize") {
+ else if (type == "Normalize") {
Value = length(Vector1);
Vector = normalize(Vector1);
}