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:
authorCharlie Jolly <mistajolly@gmail.com>2020-02-25 17:52:01 +0300
committerCharlie Jolly <mistajolly@gmail.com>2020-03-02 15:49:19 +0300
commit847c091ae838a0e5268fc327dac931c810d88d9b (patch)
tree0284badd5653d67447fc692bd61230bfc9def8b6 /intern/cycles/render
parent493c99078a8fbd8807f137401c11d401b85ba0e7 (diff)
Shading: Add invert option to Vector Rotate Node
Checkbox to invert rotation angle, suggested by @simonthommes Differential Revision: https://developer.blender.org/D6932
Diffstat (limited to 'intern/cycles/render')
-rw-r--r--intern/cycles/render/nodes.cpp19
-rw-r--r--intern/cycles/render/nodes.h1
2 files changed, 12 insertions, 8 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 4ff03d28330..a52b7f0ea00 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -6157,6 +6157,8 @@ NODE_DEFINE(VectorRotateNode)
type_enum.insert("euler_xyz", NODE_VECTOR_ROTATE_TYPE_EULER_XYZ);
SOCKET_ENUM(type, "Type", type_enum, NODE_VECTOR_ROTATE_TYPE_AXIS);
+ SOCKET_BOOLEAN(invert, "Invert", false);
+
SOCKET_IN_VECTOR(vector, "Vector", make_float3(0.0f, 0.0f, 0.0f));
SOCKET_IN_POINT(rotation, "Rotation", make_float3(0.0f, 0.0f, 0.0f));
SOCKET_IN_POINT(center, "Center", make_float3(0.0f, 0.0f, 0.0f));
@@ -6180,19 +6182,20 @@ void VectorRotateNode::compile(SVMCompiler &compiler)
ShaderInput *angle_in = input("Angle");
ShaderOutput *vector_out = output("Vector");
- compiler.add_node(NODE_VECTOR_ROTATE,
- compiler.encode_uchar4(type,
- compiler.stack_assign(vector_in),
- compiler.stack_assign(rotation_in)),
- compiler.encode_uchar4(compiler.stack_assign(center_in),
- compiler.stack_assign(axis_in),
- compiler.stack_assign(angle_in)),
- compiler.stack_assign(vector_out));
+ compiler.add_node(
+ NODE_VECTOR_ROTATE,
+ compiler.encode_uchar4(
+ type, compiler.stack_assign(vector_in), compiler.stack_assign(rotation_in), invert),
+ compiler.encode_uchar4(compiler.stack_assign(center_in),
+ compiler.stack_assign(axis_in),
+ compiler.stack_assign(angle_in)),
+ compiler.stack_assign(vector_out));
}
void VectorRotateNode::compile(OSLCompiler &compiler)
{
compiler.parameter(this, "type");
+ compiler.parameter(this, "invert");
compiler.add(this, "node_vector_rotate");
}
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 38b6b7554c0..1d76cb5e828 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -1400,6 +1400,7 @@ class VectorRotateNode : public ShaderNode {
return NODE_GROUP_LEVEL_3;
}
NodeVectorRotateType type;
+ bool invert;
float3 vector;
float3 center;
float3 axis;