Cycles: enable improved closure sampling, this should give less noise for mix, add
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 16 Oct 2011 17:40:47 +0000 (17:40 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 16 Oct 2011 17:40:47 +0000 (17:40 +0000)
and glass shaders. How well this will work on non-fermi GPU's is unclear still, it's
a bit heavy on register usage.

intern/cycles/device/device.cpp
intern/cycles/device/device.h
intern/cycles/kernel/kernel_types.h
intern/cycles/render/scene.h
intern/cycles/render/svm.cpp

index f43ccffe4614afb420fbda639b99c090d530f269..01c5081770943fbed0290d3397700ffbb0420a1e 100644 (file)
@@ -157,6 +157,8 @@ Device *Device::create(DeviceType type, bool background, int threads)
                        return NULL;
        }
 
+       device->device_type = type;
+
        return device;
 }
 
index 0b3c66dbb2c13f5ef9e2d6a851aef45b62f2cccc..360478cfd75c5f3785b4121a3c87de8b2ad24014 100644 (file)
@@ -75,12 +75,14 @@ class Device {
 protected:
        Device() {}
 
-       DeviceType type;
+       DeviceType device_type;
        bool background;
 
 public:
        virtual ~Device() {}
 
+       DeviceType type() { return device_type; }
+
        /* info */
        virtual string description() = 0;
 
index bda037e88cc6a2401e73b1843e4d9c86bd5dfaa2..c789601cd276bffe0c9bec5f37a615ee635932d6 100644 (file)
@@ -44,7 +44,7 @@ CCL_NAMESPACE_BEGIN
 #define __EMISSION__
 #define __TEXTURES__
 #define __HOLDOUT__
-//#define __MULTI_CLOSURE__
+#define __MULTI_CLOSURE__
 //#define __TRANSPARENT_SHADOWS__
 //#define __MULTI_LIGHT__
 #endif
index a969dd66c4c2fe21c392d24749556b489b571368..c191f8a56e5f58046c7ee4f5b07e9788abd16b64 100644 (file)
@@ -109,7 +109,7 @@ public:
        SceneParams()
        {
                shadingsystem = SVM;
-               use_multi_closure = false;
+               use_multi_closure = true;
                bvh_type = BVH_DYNAMIC;
                use_bvh_cache = false;
                use_bvh_spatial_split = false;
index a1687ae5e290b809f5e975a1ad7c5550b96b5710..b9c4219f85201181ad9d0214780866ef43cd3381 100644 (file)
@@ -58,6 +58,7 @@ void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
        }
        
        bool sunsky_done = false;
+       bool use_multi_closure = (scene->params.use_multi_closure && device->type() != DEVICE_OPENCL);
 
        for(i = 0; i < scene->shaders.size(); i++) {
                Shader *shader = scene->shaders[i];
@@ -70,7 +71,7 @@ void SVMShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
                        scene->light_manager->need_update = true;
 
                SVMCompiler compiler(scene->shader_manager, scene->image_manager,
-                       scene->params.use_multi_closure);
+                       use_multi_closure);
                compiler.sunsky = (sunsky_done)? NULL: &dscene->data.sunsky;
                compiler.background = ((int)i == scene->default_background);
                compiler.compile(shader, svm_nodes, i);