[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13767] trunk/blender/source/blender/ render/intern/source/rendercore.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Feb 19 18:51:58 CET 2008


Revision: 13767
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13767
Author:   blendix
Date:     2008-02-19 18:51:58 +0100 (Tue, 19 Feb 2008)

Log Message:
-----------

Fix for bug #8299: baking from selected to active with ray transparency
gave wrong results. Problem was the view vector was setup strange. While
it is really not well defined, it is now set as the negation of the normal,
so it is looking right at the surface, gives more predictable.

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

Modified: trunk/blender/source/blender/render/intern/source/rendercore.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rendercore.c	2008-02-19 16:16:16 UTC (rev 13766)
+++ trunk/blender/source/blender/render/intern/source/rendercore.c	2008-02-19 17:51:58 UTC (rev 13767)
@@ -1800,10 +1800,6 @@
 			shade_input_set_triangle_i(shi, obi, vlr, 0, 1, 2);
 	}
 		
-	/* set up view vector */
-	VECCOPY(shi->view, shi->co);
-	Normalize(shi->view);
-	
 	/* cache for shadow */
 	shi->samplenr++;
 	
@@ -1817,6 +1813,12 @@
 	/* no normal flip */
 	if(shi->flippednor)
 		shade_input_flip_normals(shi);
+
+	/* set up view vector to look right at the surface (note that the normal
+	 * is negated in the renderer so it does not need to be done here) */
+	shi->view[0]= shi->vn[0];
+	shi->view[1]= shi->vn[1];
+	shi->view[2]= shi->vn[2];
 }
 
 static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int quad, int x, int y, float u, float v, float *tvn, float *ttang)





More information about the Bf-blender-cvs mailing list