[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41065] branches/cycles/intern/cycles: Cycles: enable improved closure sampling, this should give less noise for mix, add

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Oct 16 19:40:47 CEST 2011


Revision: 41065
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41065
Author:   blendix
Date:     2011-10-16 17:40:47 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
Cycles: enable improved closure sampling, this should give less noise for mix, add
and glass shaders. How well this will work on non-fermi GPU's is unclear still, it's
a bit heavy on register usage.

Modified Paths:
--------------
    branches/cycles/intern/cycles/device/device.cpp
    branches/cycles/intern/cycles/device/device.h
    branches/cycles/intern/cycles/kernel/kernel_types.h
    branches/cycles/intern/cycles/render/scene.h
    branches/cycles/intern/cycles/render/svm.cpp

Modified: branches/cycles/intern/cycles/device/device.cpp
===================================================================
--- branches/cycles/intern/cycles/device/device.cpp	2011-10-16 17:19:29 UTC (rev 41064)
+++ branches/cycles/intern/cycles/device/device.cpp	2011-10-16 17:40:47 UTC (rev 41065)
@@ -157,6 +157,8 @@
 			return NULL;
 	}
 
+	device->device_type = type;
+
 	return device;
 }
 

Modified: branches/cycles/intern/cycles/device/device.h
===================================================================
--- branches/cycles/intern/cycles/device/device.h	2011-10-16 17:19:29 UTC (rev 41064)
+++ branches/cycles/intern/cycles/device/device.h	2011-10-16 17:40:47 UTC (rev 41065)
@@ -75,12 +75,14 @@
 protected:
 	Device() {}
 
-	DeviceType type;
+	DeviceType device_type;
 	bool background;
 
 public:
 	virtual ~Device() {}
 
+	DeviceType type() { return device_type; }
+
 	/* info */
 	virtual string description() = 0;
 

Modified: branches/cycles/intern/cycles/kernel/kernel_types.h
===================================================================
--- branches/cycles/intern/cycles/kernel/kernel_types.h	2011-10-16 17:19:29 UTC (rev 41064)
+++ branches/cycles/intern/cycles/kernel/kernel_types.h	2011-10-16 17:40:47 UTC (rev 41065)
@@ -44,7 +44,7 @@
 #define __EMISSION__
 #define __TEXTURES__
 #define __HOLDOUT__
-//#define __MULTI_CLOSURE__
+#define __MULTI_CLOSURE__
 //#define __TRANSPARENT_SHADOWS__
 //#define __MULTI_LIGHT__
 #endif

Modified: branches/cycles/intern/cycles/render/scene.h
===================================================================
--- branches/cycles/intern/cycles/render/scene.h	2011-10-16 17:19:29 UTC (rev 41064)
+++ branches/cycles/intern/cycles/render/scene.h	2011-10-16 17:40:47 UTC (rev 41065)
@@ -109,7 +109,7 @@
 	SceneParams()
 	{
 		shadingsystem = SVM;
-		use_multi_closure = false;
+		use_multi_closure = true;
 		bvh_type = BVH_DYNAMIC;
 		use_bvh_cache = false;
 		use_bvh_spatial_split = false;

Modified: branches/cycles/intern/cycles/render/svm.cpp
===================================================================
--- branches/cycles/intern/cycles/render/svm.cpp	2011-10-16 17:19:29 UTC (rev 41064)
+++ branches/cycles/intern/cycles/render/svm.cpp	2011-10-16 17:40:47 UTC (rev 41065)
@@ -58,6 +58,7 @@
 	}
 	
 	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 @@
 			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);




More information about the Bf-blender-cvs mailing list