diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-20 16:18:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-20 16:18:27 +0300 |
commit | 7e71be261bb88d0a7c1dcef7b19995317fdb51ef (patch) | |
tree | 9939d3285bea1aa9eb2e328c931162ce5adbd09f /intern/cycles/render/osl.cpp | |
parent | c4188c2bbabd87e12c7827fb30d42d2a9f61df8e (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/osl.cpp')
-rw-r--r-- | intern/cycles/render/osl.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index a02f91ad2cf..c73deb15edd 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -100,7 +100,7 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene OSLCompiler compiler((void*)this, (void*)ss, scene->image_manager); compiler.background = (shader == scene->shaders[scene->default_background]); - compiler.compile(og, shader); + compiler.compile(scene, og, shader); if(shader->use_mis && shader->has_surface_emission) scene->light_manager->need_update = true; @@ -573,6 +573,10 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath) if(node->has_object_dependency()) { current_shader->has_object_dependency = true; } + + if(node->has_integrator_dependency()) { + current_shader->has_integrator_dependency = true; + } } void OSLCompiler::parameter(const char *name, float f) @@ -788,7 +792,7 @@ OSL::ShadingAttribStateRef OSLCompiler::compile_type(Shader *shader, ShaderGraph return group; } -void OSLCompiler::compile(OSLGlobals *og, Shader *shader) +void OSLCompiler::compile(Scene *scene, OSLGlobals *og, Shader *shader) { if(shader->need_update) { ShaderGraph *graph = shader->graph; @@ -800,9 +804,16 @@ void OSLCompiler::compile(OSLGlobals *og, Shader *shader) shader->graph_bump = shader->graph->copy(); /* finalize */ - shader->graph->finalize(false, true); - if(shader->graph_bump) - shader->graph_bump->finalize(true, true); + shader->graph->finalize(scene, + false, + true, + shader->has_integrator_dependency); + if(shader->graph_bump) { + shader->graph_bump->finalize(scene, + true, + true, + shader->has_integrator_dependency); + } current_shader = shader; @@ -815,6 +826,7 @@ void OSLCompiler::compile(OSLGlobals *og, Shader *shader) shader->has_displacement = false; shader->has_heterogeneous_volume = false; shader->has_object_dependency = false; + shader->has_integrator_dependency = false; /* generate surface shader */ if(shader->used && graph && output->input("Surface")->link) { |