[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26581] trunk/blender/source/blender/ render/intern/source/rayshade.c: bugfix [#20709] Strange rendering artifacts in raytraced refraction

Campbell Barton ideasman42 at gmail.com
Wed Feb 3 14:54:09 CET 2010


Revision: 26581
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26581
Author:   campbellbarton
Date:     2010-02-03 14:54:09 +0100 (Wed, 03 Feb 2010)

Log Message:
-----------
bugfix [#20709] Strange rendering artifacts in raytraced refraction

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	2010-02-03 12:01:57 UTC (rev 26580)
+++ trunk/blender/source/blender/render/intern/source/rayshade.c	2010-02-03 13:54:09 UTC (rev 26581)
@@ -699,7 +699,8 @@
 	col[2] = col[2]*blendfac + (1.0 - blendfac)*blendcol[2];
 }
 
-/* the main recursive tracer itself */
+/* the main recursive tracer itself
+ * note: 'col' must be initialized */
 static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, float *start, float *vec, float *col, ObjectInstanceRen *obi, VlakRen *vlr, int traflag)
 {
 	ShadeInput shi;
@@ -1316,7 +1317,9 @@
 			/* no blurriness, use the original normal */
 			VECCOPY(v_refract_new, v_refract);
 		}
-	
+		
+		sampcol[0]= sampcol[1]= sampcol[2]= sampcol[3]= 0.0f;
+
 		traceray(shi, shr, shi->mat->ray_depth_tra, shi->co, v_refract_new, sampcol, shi->obi, shi->vlr, RAY_TRA|RAY_TRAFLIP);
 	
 		col[0] += sampcol[0];
@@ -1414,6 +1417,8 @@
 		else
 			reflection(v_reflect, v_nor_new, shi->view, NULL);
 		
+		sampcol[0]= sampcol[1]= sampcol[2]= sampcol[3]= 0.0f;
+
 		traceray(shi, shr, shi->mat->ray_depth, shi->co, v_reflect, sampcol, shi->obi, shi->vlr, 0);
 
 		





More information about the Bf-blender-cvs mailing list