[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15272] branches/soc-2008-unclezeiv/source /blender/render/intern/source/shadeoutput.c: fix: early tests in single_light_contrib were still returning a (single) value as in early versions, instead of updating the (two) passed variables (thanks Kent!)

Davide Vercelli davide.vercelli at gmail.com
Wed Jun 18 20:00:26 CEST 2008


Revision: 15272
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15272
Author:   unclezeiv
Date:     2008-06-18 19:59:37 +0200 (Wed, 18 Jun 2008)

Log Message:
-----------
fix: early tests in single_light_contrib were still returning a (single) value as in early versions, instead of updating the (two) passed variables (thanks Kent!)

Modified Paths:
--------------
    branches/soc-2008-unclezeiv/source/blender/render/intern/source/shadeoutput.c

Modified: branches/soc-2008-unclezeiv/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- branches/soc-2008-unclezeiv/source/blender/render/intern/source/shadeoutput.c	2008-06-18 17:21:56 UTC (rev 15271)
+++ branches/soc-2008-unclezeiv/source/blender/render/intern/source/shadeoutput.c	2008-06-18 17:59:37 UTC (rev 15272)
@@ -2105,12 +2105,17 @@
 	
 	vn= shi->vn;
 	
-	if (lar->energy == 0.0) return 0.0f;
+	if (lar->energy == 0.0) {
+		*pi= *pi_noshad= 0.0f;
+		return;
+	}
 	
 	/* lampdist, spot angle, area side, ... */
 	visifac= lamp_get_visibility(lar, shi->co, lv, &lampdist);
-	if(visifac==0.0f)
-		return 0.0f;
+	if(visifac==0.0f) {
+		*pi= *pi_noshad= 0.0f;
+		return;
+	}
 
 	/* dot product and reflectivity */
 	/* inp = dotproduct, is = shader result, i = lamp energy (with shadow), i_noshad = i without shadow */





More information about the Bf-blender-cvs mailing list