[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12596] trunk/blender/source/blender/ render/intern/source/rayshade.c: * Fixed own bug: glossy reflections was erroneously giving a

Matt Ebb matt at mke3.net
Thu Nov 15 07:07:03 CET 2007


Revision: 12596
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12596
Author:   broken
Date:     2007-11-15 07:07:02 +0100 (Thu, 15 Nov 2007)

Log Message:
-----------
* Fixed own bug: glossy reflections was erroneously giving a 
distorted copy of the original face normal, meaning that on 
smooth shaded faces, sometimes the check to keep rays 
reflected out away from the face wasn't working, and the ray 
would intersect when it shouldn't. 

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	2007-11-15 00:11:00 UTC (rev 12595)
+++ trunk/blender/source/blender/render/intern/source/rayshade.c	2007-11-15 06:07:02 UTC (rev 12596)
@@ -988,7 +988,7 @@
 	int samp_type;
 	
 	float samp3d[3], orthx[3], orthy[3];
-	float v_nor_new[3], v_facenor_new[3], v_reflect[3];
+	float v_nor_new[3], v_reflect[3];
 	float sampcol[4], colsq[4];
 		
 	float blur = pow(1.0 - shi->mat->gloss_mir, 3);
@@ -1011,8 +1011,6 @@
 	} else 
 		max_samples = 1;
 	
-	VECCOPY(v_facenor_new, shi->facenor);
-	
 	while (samples < max_samples) {
 				
 		if (max_samples > 1) {
@@ -1035,17 +1033,14 @@
 			/* and perturb the normal in it */
 			VecAddf(v_nor_new, shi->vn, orthx);
 			VecAddf(v_nor_new, v_nor_new, orthy);
-			VecAddf(v_facenor_new, shi->facenor, orthx);
-			VecAddf(v_facenor_new, v_facenor_new, orthy);
 			Normalize(v_nor_new);
-			Normalize(v_facenor_new);
 		} else {
 			/* no blurriness, use the original normal */
 			VECCOPY(v_nor_new, shi->vn);
 		}
 		
 		if((shi->vlr->flag & R_SMOOTH)) 
-			reflection(v_reflect, v_nor_new, shi->view, v_facenor_new);
+			reflection(v_reflect, v_nor_new, shi->view, shi->facenor);
 		else
 			reflection(v_reflect, v_nor_new, shi->view, NULL);
 		





More information about the Bf-blender-cvs mailing list