[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43793] trunk/blender/intern/cycles/kernel /kernel_shader.h: Fix #30011 & #30027: cycles division by zero evaluating BSDF with zero weights,

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Jan 31 16:59:36 CET 2012


Revision: 43793
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43793
Author:   blendix
Date:     2012-01-31 15:59:30 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
Fix #30011 & #30027: cycles division by zero evaluating BSDF with zero weights,
showed up as NaN on GPU render.

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

Modified: trunk/blender/intern/cycles/kernel/kernel_shader.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_shader.h	2012-01-31 14:57:46 UTC (rev 43792)
+++ trunk/blender/intern/cycles/kernel/kernel_shader.h	2012-01-31 15:59:30 UTC (rev 43793)
@@ -300,7 +300,7 @@
 		}
 	}
 
-	*pdf = sum_pdf/sum_sample_weight;
+	*pdf = (sum_sample_weight > 0.0f)? sum_pdf/sum_sample_weight: 0.0f;
 }
 
 #endif



More information about the Bf-blender-cvs mailing list