[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45028] trunk/blender/intern/cycles/kernel : Cycles: fix issue reported in IRC, rendering a material that mixes a transparent

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Mar 20 17:16:20 CET 2012


Revision: 45028
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45028
Author:   blendix
Date:     2012-03-20 16:16:17 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
Cycles: fix issue reported in IRC, rendering a material that mixes a transparent
and glass BSDF would give a different result with/without using light passes.

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/kernel_accumulate.h
    trunk/blender/intern/cycles/kernel/kernel_path.h

Modified: trunk/blender/intern/cycles/kernel/kernel_accumulate.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_accumulate.h	2012-03-20 14:23:22 UTC (rev 45027)
+++ trunk/blender/intern/cycles/kernel/kernel_accumulate.h	2012-03-20 16:16:17 UTC (rev 45028)
@@ -151,26 +151,20 @@
 
 #ifdef __PASSES__
 	if(L->use_light_pass) {
-		if(bounce == 0) {
-			if(bsdf_label & LABEL_TRANSPARENT) {
-				/* transparent bounce before first hit */
-				*throughput *= bsdf_eval->transparent*inverse_pdf;
-			}
-			else {
-				/* first on directly visible surface */
-				float3 value = *throughput*inverse_pdf;
+		if(bounce == 0 && !(bsdf_label & LABEL_TRANSPARENT)) {
+			/* first on directly visible surface */
+			float3 value = *throughput*inverse_pdf;
 
-				L->indirect_diffuse = bsdf_eval->diffuse*value;
-				L->indirect_glossy = bsdf_eval->glossy*value;
-				L->indirect_transmission = bsdf_eval->transmission*value;
+			L->indirect_diffuse = bsdf_eval->diffuse*value;
+			L->indirect_glossy = bsdf_eval->glossy*value;
+			L->indirect_transmission = bsdf_eval->transmission*value;
 
-				*throughput = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission;
-				
-				L->direct_throughput = *throughput;
-			}
+			*throughput = L->indirect_diffuse + L->indirect_glossy + L->indirect_transmission;
+			
+			L->direct_throughput = *throughput;
 		}
 		else {
-			/* indirectly visible through BSDF */
+			/* transparent bounce before first hit, or indirectly visible through BSDF */
 			float3 sum = (bsdf_eval->diffuse + bsdf_eval->glossy + bsdf_eval->transmission + bsdf_eval->transparent)*inverse_pdf;
 			*throughput *= sum;
 		}

Modified: trunk/blender/intern/cycles/kernel/kernel_path.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_path.h	2012-03-20 14:23:22 UTC (rev 45027)
+++ trunk/blender/intern/cycles/kernel/kernel_path.h	2012-03-20 16:16:17 UTC (rev 45028)
@@ -288,7 +288,6 @@
 
 		throughput /= probability;
 
-
 #ifdef __AO__
 		/* ambient occlusion */
 		if(kernel_data.integrator.use_ambient_occlusion) {




More information about the Bf-blender-cvs mailing list