Land D2339 by bliblu bli
authorlazydodo <github@lazydodo.com>
Fri, 9 Dec 2016 15:28:04 +0000 (08:28 -0700)
committerlazydodo <github@lazydodo.com>
Fri, 9 Dec 2016 15:28:04 +0000 (08:28 -0700)
intern/cycles/device/device.cpp
intern/cycles/device/device.h
intern/cycles/kernel/kernel_types.h
intern/cycles/render/session.cpp
intern/cycles/render/shader.cpp

index ff9387b0a8ab6fdac7cfdd16f29691754a3ed094..31c99f49d6d5c447ed48c9cd1ce759202b432541 100644 (file)
@@ -64,6 +64,8 @@ std::ostream& operator <<(std::ostream &os,
           << string_from_bool(requested_features.use_integrator_branched) << std::endl;
        os << "Use Patch Evaluation: "
           << string_from_bool(requested_features.use_patch_evaluation) << std::endl;
+       os << "Use Transparent Shadows: "
+          << string_from_bool(requested_features.use_transparent) << std::endl;
        return os;
 }
 
index 988ad10607dde4926bb73902e89fba9d83dbba7c..ccee25ae34e0ad8ecaac02fd5d13c073b99a3d50 100644 (file)
@@ -117,6 +117,9 @@ public:
 
        /* Use OpenSubdiv patch evaluation */
        bool use_patch_evaluation;
+       
+       /* Use Transparent shadows */
+       bool use_transparent;
 
        DeviceRequestedFeatures()
        {
@@ -133,6 +136,7 @@ public:
                use_volume = false;
                use_integrator_branched = false;
                use_patch_evaluation = false;
+               use_transparent = false;
        }
 
        bool modified(const DeviceRequestedFeatures& requested_features)
@@ -148,7 +152,8 @@ public:
                         use_subsurface == requested_features.use_subsurface &&
                         use_volume == requested_features.use_volume &&
                         use_integrator_branched == requested_features.use_integrator_branched &&
-                        use_patch_evaluation == requested_features.use_patch_evaluation);
+                        use_patch_evaluation == requested_features.use_patch_evaluation &&
+                        use_transparent == requested_features.use_transparent);
        }
 
        /* Convert the requested features structure to a build options,
@@ -189,6 +194,9 @@ public:
                if(!use_patch_evaluation) {
                        build_options += " -D__NO_PATCH_EVAL__";
                }
+               if(!use_transparent) {
+                       build_options += " -D__NO_TRANSPARENT__";
+               }
                return build_options;
        }
 };
index a6c31d4a518a36b785610f138eb276451860471d..fd961836ec9de3ae538f693bac9c4cefed3d9c1a 100644 (file)
@@ -192,6 +192,9 @@ CCL_NAMESPACE_BEGIN
 #ifdef __NO_PATCH_EVAL__
 #  undef __PATCH_EVAL__
 #endif
+#ifdef __NO_TRANSPARENT__
+#  undef __TRANSPARENT_SHADOWS__
+#endif
 
 /* Random Numbers */
 
index 8e90224321135bd1ba0ba768f70457c7186593b2..337210487220d142aff6ab2117ea581ab53b3f7b 100644 (file)
@@ -636,6 +636,7 @@ 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;
 
        return requested_features;
 }
index 06b6dd969d871a0f0522033b5f76bfcc8e6b683f..335edcbe609c2cde8b4497a03da32587a88b5e5a 100644 (file)
@@ -571,6 +571,9 @@ void ShaderManager::get_requested_graph_features(ShaderGraph *graph,
                if(node->has_surface_bssrdf()) {
                        requested_features->use_subsurface = true;
                }
+               if(node->has_surface_transparent()) {
+                       requested_features->use_transparent = true;
+               }
        }
 }