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.
This commit is contained in:
Brecht Van Lommel 2011-10-16 17:40:47 +00:00
parent 11f3029267
commit 60bc63c7b8
5 changed files with 9 additions and 4 deletions

@ -157,6 +157,8 @@ Device *Device::create(DeviceType type, bool background, int threads)
return NULL;
}
device->device_type = type;
return device;
}

@ -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;

@ -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

@ -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;

@ -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);