[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20196] trunk/blender/source/blender/ render/intern/source/rayshade.c: Bugfix #18743

Ton Roosendaal ton at blender.org
Thu May 14 13:36:52 CEST 2009


Revision: 20196
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20196
Author:   ton
Date:     2009-05-14 13:36:52 +0200 (Thu, 14 May 2009)

Log Message:
-----------
Bugfix #18743

Render: raytracing materials with transp-shadow + SSS crashed 

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

Modified: trunk/blender/source/blender/render/intern/source/rayshade.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rayshade.c	2009-05-14 10:59:38 UTC (rev 20195)
+++ trunk/blender/source/blender/render/intern/source/rayshade.c	2009-05-14 11:36:52 UTC (rev 20196)
@@ -1274,7 +1274,7 @@
 	shadfac[3]= (1.0f-alpha)*shadfac[3];
 }
 
-static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag)
+static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int traflag)
 {
 	/* ray to lamp, find first face that intersects, check alpha properties,
 	   if it has col[3]>0.0f  continue. so exit when alpha is full */
@@ -1291,10 +1291,14 @@
 		/* end warning! - Campbell */
 		
 		shi.depth= 1;					/* only used to indicate tracing */
-		shi.mask= 1;
-		shi.thread= thread;
+		shi.mask= origshi->mask;
+		shi.thread= origshi->thread;
 		shi.passflag= SCE_PASS_COMBINED;
 		shi.combinedflag= 0xFFFFFF;		 /* ray trace does all options */
+	
+		shi.xs= origshi->xs;
+		shi.ys= origshi->ys;
+		shi.lay= origshi->lay;
 		
 		shade_ray(is, &shi, &shr);
 		if (traflag & RAY_TRA)
@@ -1310,7 +1314,7 @@
 			is->oborig= RAY_OBJECT_SET(&R, shi.obi);
 			is->faceorig= (RayFace*)shi.vlr;
 
-			ray_trace_shadow_tra(is, thread, depth-1, traflag | RAY_TRA);
+			ray_trace_shadow_tra(is, origshi, depth-1, traflag | RAY_TRA);
 		}
 	}
 }
@@ -1938,7 +1942,7 @@
 			isec->col[0]= isec->col[1]= isec->col[2]=  1.0f;
 			isec->col[3]= 1.0f;
 			
-			ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0);
+			ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0);
 			shadfac[0] += isec->col[0];
 			shadfac[1] += isec->col[1];
 			shadfac[2] += isec->col[2];
@@ -2036,7 +2040,7 @@
 			isec->col[0]= isec->col[1]= isec->col[2]=  1.0f;
 			isec->col[3]= 1.0f;
 			
-			ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0);
+			ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0);
 			shadfac[0] += isec->col[0];
 			shadfac[1] += isec->col[1];
 			shadfac[2] += isec->col[2];
@@ -2117,7 +2121,7 @@
 				isec.col[0]= isec.col[1]= isec.col[2]=  1.0f;
 				isec.col[3]= 1.0f;
 
-				ray_trace_shadow_tra(&isec, shi->thread, DEPTH_SHADOW_TRA, 0);
+				ray_trace_shadow_tra(&isec, shi, DEPTH_SHADOW_TRA, 0);
 				QUATCOPY(shadfac, isec.col);
 			}
 			else if(RE_ray_tree_intersect(R.raytree, &isec)) shadfac[3]= 0.0f;





More information about the Bf-blender-cvs mailing list