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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-11-20 16:18:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-11-20 16:18:27 +0300
commit7e71be261bb88d0a7c1dcef7b19995317fdb51ef (patch)
tree9939d3285bea1aa9eb2e328c931162ce5adbd09f /intern/cycles/render/graph.cpp
parentc4188c2bbabd87e12c7827fb30d42d2a9f61df8e (diff)
Cycles: Fix filter glossy being broken after recent changes
Basically we can not use sharp closure as a substitude when filter glossy is used. This is because we can not blur sharp reflection/refraction. This is quite quick and not really clean implementation. Not really happy with manual handling of original settings, but this is as good as we can do in the quick patch. It's a good acknowledgment and we now can re-consider some aspects of graph simplification to make such cases more natively supported. P.S. This failure would have been shown by our regression tests, so please, bother a bit to run Cycles's test sweep before doing such optimizations.
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r--intern/cycles/render/graph.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 749640040f5..7e6e960d585 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -266,7 +266,10 @@ void ShaderGraph::relink(vector<ShaderInput*> inputs, vector<ShaderInput*> outpu
}
}
-void ShaderGraph::finalize(bool do_bump, bool do_osl)
+void ShaderGraph::finalize(Scene *scene,
+ bool do_bump,
+ bool do_osl,
+ bool do_simplify)
{
/* before compiling, the shader graph may undergo a number of modifications.
* currently we set default geometry shader inputs, and create automatic bump
@@ -274,7 +277,7 @@ void ShaderGraph::finalize(bool do_bump, bool do_osl)
* modified afterwards. */
if(!finalized) {
- clean();
+ clean(scene);
default_inputs(do_osl);
refine_bump_nodes();
@@ -293,6 +296,9 @@ void ShaderGraph::finalize(bool do_bump, bool do_osl)
finalized = true;
}
+ else if(do_simplify) {
+ simplify_nodes(scene);
+ }
}
void ShaderGraph::find_dependencies(set<ShaderNode*>& dependencies, ShaderInput *input)
@@ -557,10 +563,10 @@ void ShaderGraph::remove_unneeded_nodes()
}
/* Step 3: Simplification.*/
-void ShaderGraph::simplify_nodes()
+void ShaderGraph::simplify_nodes(Scene *scene)
{
foreach(ShaderNode *node, nodes) {
- node->optimize();
+ node->optimize(scene);
}
}
@@ -588,7 +594,7 @@ void ShaderGraph::break_cycles(ShaderNode *node, vector<bool>& visited, vector<b
on_stack[node->id] = false;
}
-void ShaderGraph::clean()
+void ShaderGraph::clean(Scene *scene)
{
/* Graph simplification:
* 1: Remove unnecesarry nodes
@@ -604,7 +610,7 @@ void ShaderGraph::clean()
/* TODO(dingto): Implement */
/* 3: Simplification. */
- simplify_nodes();
+ simplify_nodes(scene);
/* 4: De-duplication. */
/* TODO(dingto): Implement */