diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-07-03 01:03:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-07-03 01:03:16 +0400 |
commit | 65cbcde831d4dcefcc92abdc63d9fe785e6cff4c (patch) | |
tree | a2f2f5900b618d39c11ce1071f4e2cbebc9743d3 /intern/cycles | |
parent | 4848ca09c0275c979b35471e6d0d481a54b464c9 (diff) |
Fix cycles world ray visibility not working correct with multiple importance
sampling.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/light.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 5ac21ed5996..276647e6b2f 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -16,6 +16,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "background.h" #include "device.h" #include "integrator.h" #include "film.h" @@ -568,9 +569,24 @@ void LightManager::device_update_points(Device *device, DeviceScene *dscene, Sce light_data[i*LIGHT_SIZE + 3] = make_float4(samples, 0.0f, 0.0f, 0.0f); } else if(light->type == LIGHT_BACKGROUND) { + uint visibility = scene->background->visibility; + shader_id &= ~SHADER_AREA_LIGHT; shader_id |= SHADER_USE_MIS; + if(!(visibility & PATH_RAY_DIFFUSE)) { + shader_id |= SHADER_EXCLUDE_DIFFUSE; + use_light_visibility = true; + } + if(!(visibility & PATH_RAY_GLOSSY)) { + shader_id |= SHADER_EXCLUDE_GLOSSY; + use_light_visibility = true; + } + if(!(visibility & PATH_RAY_TRANSMIT)) { + shader_id |= SHADER_EXCLUDE_TRANSMIT; + use_light_visibility = true; + } + light_data[i*LIGHT_SIZE + 0] = make_float4(__int_as_float(light->type), 0.0f, 0.0f, 0.0f); light_data[i*LIGHT_SIZE + 1] = make_float4(__int_as_float(shader_id), 0.0f, 0.0f, 0.0f); light_data[i*LIGHT_SIZE + 2] = make_float4(0.0f, 0.0f, 0.0f, 0.0f); |