Cycles: remove option to disable transparent shadows globally.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 2 Aug 2017 13:23:50 +0000 (15:23 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 7 Aug 2017 12:01:24 +0000 (14:01 +0200)
We already detect this automatically based on shading nodes and per shader
settings, and performance of this option is ok now all devices.

Differential Revision: https://developer.blender.org/D2767

intern/cycles/blender/addon/presets.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_sync.cpp
intern/cycles/render/integrator.cpp
intern/cycles/render/integrator.h
intern/cycles/render/session.cpp
intern/cycles/render/shader.cpp

index 440221b847098d0886b26a88aa3d323d91a84716..17efb00abdb85873fb6387e7d5cf6d7ccf9ececf 100644 (file)
@@ -37,7 +37,6 @@ class AddPresetIntegrator(AddPresetBase, Operator):
         "cycles.transmission_bounces",
         "cycles.volume_bounces",
         "cycles.transparent_max_bounces",
-        "cycles.use_transparent_shadows",
         "cycles.caustics_reflective",
         "cycles.caustics_refractive",
         "cycles.blur_glossy"
index cb5b13f8d3a5005ff284ad9ac7977c9cf12a9c85..c744c1d6932f8042fd773f72744faf024d3fa297 100644 (file)
@@ -349,11 +349,6 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
                 min=0, max=1024,
                 default=8,
                 )
-        cls.use_transparent_shadows = BoolProperty(
-                name="Transparent Shadows",
-                description="Use transparency of surfaces for rendering shadows",
-                default=True,
-                )
 
         cls.volume_step_size = FloatProperty(
                 name="Step Size",
index 45a77aa8c383fe57a2bbe5a525dd8442a5858e08..b9565aa4c7fa468939b84c5b82af25980838ab89 100644 (file)
@@ -292,7 +292,6 @@ class CyclesRender_PT_light_paths(CyclesButtonsPanel, Panel):
         sub = col.column(align=True)
         sub.label("Transparency:")
         sub.prop(cscene, "transparent_max_bounces", text="Max")
-        sub.prop(cscene, "use_transparent_shadows", text="Shadows")
 
         col.separator()
 
index ddaa962f63d8fef959265f275335ff0d8194e40b..e953c685b565be351d680836251f903a8c9c32a5 100644 (file)
@@ -242,7 +242,6 @@ void BlenderSync::sync_integrator()
        integrator->max_volume_bounce = get_int(cscene, "volume_bounces");
 
        integrator->transparent_max_bounce = get_int(cscene, "transparent_max_bounces");
-       integrator->transparent_shadows = get_boolean(cscene, "use_transparent_shadows");
 
        integrator->volume_max_steps = get_int(cscene, "volume_max_steps");
        integrator->volume_step_size = get_float(cscene, "volume_step_size");
index b9b8c681a262daaf2e0b2eaaf0b20ea4d9b5768a..15b728d6e027c5366c8466f16d91757006d03178 100644 (file)
@@ -39,7 +39,6 @@ NODE_DEFINE(Integrator)
        SOCKET_INT(max_volume_bounce, "Max Volume Bounce", 7);
 
        SOCKET_INT(transparent_max_bounce, "Transparent Max Bounce", 7);
-       SOCKET_BOOLEAN(transparent_shadows, "Transparent Shadows", false);
 
        SOCKET_INT(ao_bounces, "AO Bounces", 0);
 
@@ -121,19 +120,14 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
         * We only need to enable transparent shadows, if we actually have 
         * transparent shaders in the scene. Otherwise we can disable it
         * to improve performance a bit. */
-       if(transparent_shadows) {
-               kintegrator->transparent_shadows = false;
-               foreach(Shader *shader, scene->shaders) {
-                       /* keep this in sync with SD_HAS_TRANSPARENT_SHADOW in shader.cpp */
-                       if((shader->has_surface_transparent && shader->use_transparent_shadow) || shader->has_volume) {
-                               kintegrator->transparent_shadows = true;
-                               break;
-                       }
+       kintegrator->transparent_shadows = false;
+       foreach(Shader *shader, scene->shaders) {
+               /* keep this in sync with SD_HAS_TRANSPARENT_SHADOW in shader.cpp */
+               if((shader->has_surface_transparent && shader->use_transparent_shadow) || shader->has_volume) {
+                       kintegrator->transparent_shadows = true;
+                       break;
                }
        }
-       else {
-               kintegrator->transparent_shadows = false;
-       }
 
        kintegrator->volume_max_steps = volume_max_steps;
        kintegrator->volume_step_size = volume_step_size;
index ce5651ec823b6ee149cdfb4b57fcbc78fabb6352..3cb430d72b40bb03aa6d18dd6a553bd075076e9d 100644 (file)
@@ -39,7 +39,6 @@ public:
        int max_volume_bounce;
 
        int transparent_max_bounce;
-       bool transparent_shadows;
 
        int ao_bounces;
 
index 8622318858e61538fa6373fca4ccc56f019408d8..ca3aefcb5e60d700879ec73ff07507d7be0e57bd 100644 (file)
@@ -721,7 +721,6 @@ DeviceRequestedFeatures Session::get_requested_device_features()
        BakeManager *bake_manager = scene->bake_manager;
        requested_features.use_baking = bake_manager->get_baking();
        requested_features.use_integrator_branched = (scene->integrator->method == Integrator::BRANCHED_PATH);
-       requested_features.use_transparent &= scene->integrator->transparent_shadows;
        requested_features.use_denoising = params.use_denoising;
 
        return requested_features;
index 44a266dfe18b97d7e93cb830007f81b67c8e8b5b..493e01de36344cc4a7897dd2a73c932e59119b1a 100644 (file)
@@ -503,9 +503,7 @@ void ShaderManager::device_update_common(Device *device,
        KernelIntegrator *kintegrator = &dscene->data.integrator;
        kintegrator->use_volumes = has_volumes;
        /* TODO(sergey): De-duplicate with flags set in integrator.cpp. */
-       if(scene->integrator->transparent_shadows) {
-               kintegrator->transparent_shadows = has_transparent_shadow;
-       }
+       kintegrator->transparent_shadows = has_transparent_shadow;
 }
 
 void ShaderManager::device_free_common(Device *device, DeviceScene *dscene, Scene *scene)