[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11396] trunk/blender/source/blender/ render/intern/source/shadeoutput.c: Previous bugfix for shadows cast on objects with diffuse reflectivity set to 0

Joseph Eagar joeedh at gmail.com
Fri Jul 27 23:54:02 CEST 2007


Revision: 11396
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11396
Author:   joeedh
Date:     2007-07-27 23:54:01 +0200 (Fri, 27 Jul 2007)

Log Message:
-----------
Previous bugfix for shadows cast on objects with diffuse reflectivity set to 0 
caused errors on only shadow lamps; fixed this by adding back in the original 
intensity > 0.0 check in the only shadow if statement, where it belonged in the
first place.

In addition, the specular pass was not correctly affected by only shadow lamps,
severely reducing the usefulness of this feature.  For example, using four
spotlamps to create an omnidirectional buffered shadow lamp didn't work.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/shadeoutput.c

Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c	2007-07-27 18:29:58 UTC (rev 11395)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2007-07-27 21:54:01 UTC (rev 11396)
@@ -1245,12 +1245,16 @@
 						lamp_get_shadow(lar, shi, inp, shadfac, shi->depth);
 						
 					/* warning, here it skips the loop */
-					if(lar->mode & LA_ONLYSHADOW) {
+					if((lar->mode & LA_ONLYSHADOW) && i>0.0) {
 						
 						shadfac[3]= i*lar->energy*(1.0f-shadfac[3]);
 						shr->shad[0] -= shadfac[3]*shi->r;
 						shr->shad[1] -= shadfac[3]*shi->g;
 						shr->shad[2] -= shadfac[3]*shi->b;
+						
+						shr->spec[0] -= shadfac[3]*shi->r;
+						shr->spec[1] -= shadfac[3]*shi->g;
+						shr->spec[2] -= shadfac[3]*shi->b;
 						return;
 					}
 					
@@ -1280,7 +1284,7 @@
 		}
 		
 		/* specularity */
-		if(shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC)) {
+		if(shadfac[3]>0.0f && shi->spec!=0.0f && !(lar->mode & LA_NO_SPEC) && !(lar->mode & LA_ONLYSHADOW)) {
 			
 			if(!(passflag & (SCE_PASS_COMBINED|SCE_PASS_SPEC)));
 			else if(lar->type==LA_HEMI) {





More information about the Bf-blender-cvs mailing list