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:
authorLukas Stockner <lukas.stockner@freenet.de>2016-06-21 01:19:51 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2016-06-21 01:19:51 +0300
commit93c6cf496edff358c919d62295c031fc5eebb155 (patch)
tree28fc7eba70a7c7f08e57aad8221ee2a454d9c498 /intern/cycles/render/nodes.h
parenta170607578b8911df30039dacf7399506476be87 (diff)
Cycles: Deduplicate Vector and RGB Curve nodes
Since most of the code for these two nodes was identical, this commit now instead uses a common base class that implements all the functionality.
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r--intern/cycles/render/nodes.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 978908f4c78..3245fdfb6d9 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -875,26 +875,30 @@ public:
float distance;
};
-class RGBCurvesNode : public ShaderNode {
+class CurvesNode : public ShaderNode {
public:
- SHADER_NODE_CLASS(RGBCurvesNode)
+ explicit CurvesNode(const NodeType *node_type);
+ SHADER_NODE_BASE_CLASS(CurvesNode);
virtual int get_group() { return NODE_GROUP_LEVEL_3; }
+ bool has_spatial_varying() { return true; }
+ void compile(SVMCompiler& compiler, int type, ShaderInput *value_in, ShaderOutput *value_out);
+ void compile(OSLCompiler& compiler, const char *name);
+
array<float3> curves;
float min_x, max_x, fac;
- float3 color;
+ float3 value;
};
-class VectorCurvesNode : public ShaderNode {
+class RGBCurvesNode : public CurvesNode {
public:
- SHADER_NODE_CLASS(VectorCurvesNode)
-
- virtual int get_group() { return NODE_GROUP_LEVEL_3; }
+ SHADER_NODE_CLASS(RGBCurvesNode)
+};
- array<float3> curves;
- float min_x, max_x, fac;
- float3 vector;
+class VectorCurvesNode : public CurvesNode {
+public:
+ SHADER_NODE_CLASS(VectorCurvesNode)
};
class RGBRampNode : public ShaderNode {