diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2020-02-25 17:52:01 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2020-03-02 15:49:19 +0300 |
commit | 847c091ae838a0e5268fc327dac931c810d88d9b (patch) | |
tree | 0284badd5653d67447fc692bd61230bfc9def8b6 /intern/cycles/render/nodes.cpp | |
parent | 493c99078a8fbd8807f137401c11d401b85ba0e7 (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/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 19 |
1 files changed, 11 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"); } |