[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57948] trunk/blender/intern/cycles/render /light.cpp: Fix cycles world ray visibility not working correct with multiple importance

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Jul 2 23:03:17 CEST 2013


Revision: 57948
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57948
Author:   blendix
Date:     2013-07-02 21:03:16 +0000 (Tue, 02 Jul 2013)
Log Message:
-----------
Fix cycles world ray visibility not working correct with multiple importance
sampling.

Modified Paths:
--------------
    trunk/blender/intern/cycles/render/light.cpp

Modified: trunk/blender/intern/cycles/render/light.cpp
===================================================================
--- trunk/blender/intern/cycles/render/light.cpp	2013-07-02 20:36:52 UTC (rev 57947)
+++ trunk/blender/intern/cycles/render/light.cpp	2013-07-02 21:03:16 UTC (rev 57948)
@@ -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 @@
 			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);




More information about the Bf-blender-cvs mailing list