diff options
author | Thomas Dinges <blender@dingto.org> | 2016-02-06 00:13:51 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2016-02-06 00:13:51 +0300 |
commit | 469447f7077e42ec73d71e51f8f6bebc918fdfa6 (patch) | |
tree | f3c080413cc8e54c90b0c0650a46ccf16ccd1bc6 /intern/cycles/render/osl.cpp | |
parent | ca88bc5ac13efd8ea7157ab97396db51bb0bda64 (diff) |
Cycles: Auto disable World MIS, if we only use a simple color.
When World MIS is enabled by the user, we now check if we actually need it.
In case of a simple node setup (no procedurals, no HDRs..) we auto disable MIS internally to save render time.
This change is important for upcoming default changes.
Diffstat (limited to 'intern/cycles/render/osl.cpp')
-rw-r--r-- | intern/cycles/render/osl.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 81c706ca1bc..67b07f1192e 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -570,14 +570,20 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath) /* test if we shader contains specific closures */ OSLShaderInfo *info = ((OSLShaderManager*)manager)->shader_loaded_info(name); - if(info && current_type == SHADER_TYPE_SURFACE) { - if(info->has_surface_emission) - current_shader->has_surface_emission = true; - if(info->has_surface_transparent) - current_shader->has_surface_transparent = true; - if(info->has_surface_bssrdf) { - current_shader->has_surface_bssrdf = true; - current_shader->has_bssrdf_bump = true; /* can't detect yet */ + if(current_type == SHADER_TYPE_SURFACE) { + if(info) { + if(info->has_surface_emission) + current_shader->has_surface_emission = true; + if(info->has_surface_transparent) + current_shader->has_surface_transparent = true; + if(info->has_surface_bssrdf) { + current_shader->has_surface_bssrdf = true; + current_shader->has_bssrdf_bump = true; /* can't detect yet */ + } + } + + if(node->has_spatial_varying()) { + current_shader->has_surface_spatial_varying = true; } } else if(current_type == SHADER_TYPE_VOLUME) { @@ -752,6 +758,8 @@ void OSLCompiler::generate_nodes(const ShaderNodeSet& nodes) current_shader->has_surface_emission = true; if(node->has_surface_transparent()) current_shader->has_surface_transparent = true; + if(node->has_spatial_varying()) + current_shader->has_surface_spatial_varying = true; if(node->has_surface_bssrdf()) { current_shader->has_surface_bssrdf = true; if(node->has_bssrdf_bump()) @@ -839,6 +847,7 @@ void OSLCompiler::compile(Scene *scene, OSLGlobals *og, Shader *shader) shader->has_bssrdf_bump = false; shader->has_volume = false; shader->has_displacement = false; + shader->has_surface_spatial_varying = false; shader->has_volume_spatial_varying = false; shader->has_object_dependency = false; shader->has_integrator_dependency = false; |