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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-27 01:59:41 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-11-27 01:59:41 +0400
commitceed3ef640bb40e1232feeb409220fe19011bc43 (patch)
tree48ad960f483ad185718b14bbc605b6182732f56c /intern/cycles/render/graph.h
parenteab58bf994323a53311543d7d706b0be87ffe197 (diff)
Fix #32907: failure rendering a complex node setup, hitting fixed max number
of closures limit. Optimized the code now so it can handle more. Change SVM mix/add closure handling, now we transform the node graph so that the mix weights are fed into the closure nodes directly.
Diffstat (limited to 'intern/cycles/render/graph.h')
-rw-r--r--intern/cycles/render/graph.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h
index 373c7e0eaab..b79167839ab 100644
--- a/intern/cycles/render/graph.h
+++ b/intern/cycles/render/graph.h
@@ -118,6 +118,12 @@ public:
NONE
};
+ enum Usage {
+ USE_SVM = 1,
+ USE_OSL = 2,
+ USE_ALL = USE_SVM|USE_OSL
+ };
+
ShaderInput(ShaderNode *parent, const char *name, ShaderSocketType type);
void set(const float3& v) { value = v; }
void set(float f) { value = make_float3(f, 0, 0); }
@@ -134,7 +140,7 @@ public:
ustring value_string;
int stack_offset; /* for SVM compiler */
- bool osl_only;
+ int usage;
};
/* Output
@@ -167,9 +173,9 @@ public:
ShaderInput *input(const char *name);
ShaderOutput *output(const char *name);
- ShaderInput *add_input(const char *name, ShaderSocketType type, float value=0.0f);
- ShaderInput *add_input(const char *name, ShaderSocketType type, float3 value);
- ShaderInput *add_input(const char *name, ShaderSocketType type, ShaderInput::DefaultValue value, bool osl_only=false);
+ ShaderInput *add_input(const char *name, ShaderSocketType type, float value=0.0f, int usage=ShaderInput::USE_ALL);
+ ShaderInput *add_input(const char *name, ShaderSocketType type, float3 value, int usage=ShaderInput::USE_ALL);
+ ShaderInput *add_input(const char *name, ShaderSocketType type, ShaderInput::DefaultValue value, int usage=ShaderInput::USE_ALL);
ShaderOutput *add_output(const char *name, ShaderSocketType type);
virtual ShaderNode *clone() const = 0;
@@ -227,7 +233,7 @@ public:
void connect(ShaderOutput *from, ShaderInput *to);
void disconnect(ShaderInput *to);
- void finalize(bool do_bump = false, bool do_osl = false);
+ void finalize(bool do_bump = false, bool do_osl = false, bool do_multi_closure = false);
protected:
typedef pair<ShaderNode* const, ShaderNode*> NodePair;
@@ -241,6 +247,7 @@ protected:
void bump_from_displacement();
void refine_bump_nodes();
void default_inputs(bool do_osl);
+ void transform_multi_closure(ShaderNode *node, ShaderOutput *weight_out, bool volume);
};
CCL_NAMESPACE_END