[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27607] branches/render25/source/blender/ render/intern/source: Render Branch: some quick tweaks to make transparent shadow + node materials

Brecht Van Lommel brecht at blender.org
Thu Mar 18 19:19:49 CET 2010


Revision: 27607
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27607
Author:   blendix
Date:     2010-03-18 19:19:49 +0100 (Thu, 18 Mar 2010)

Log Message:
-----------
Render Branch: some quick tweaks to make transparent shadow + node materials
performance bareable, new shading system will solve this automatically.

Modified Paths:
--------------
    branches/render25/source/blender/render/intern/source/rayshade.c
    branches/render25/source/blender/render/intern/source/shadeoutput.c

Modified: branches/render25/source/blender/render/intern/source/rayshade.c
===================================================================
--- branches/render25/source/blender/render/intern/source/rayshade.c	2010-03-18 17:41:18 UTC (rev 27606)
+++ branches/render25/source/blender/render/intern/source/rayshade.c	2010-03-18 18:19:49 UTC (rev 27607)
@@ -586,13 +586,17 @@
 		}
 	}
 	else if(is->mode==RE_RAY_SHADOW_TRA) {
+		/* don't run nodes for now, it will do slow full shading .. */
+#if 0
 		/* temp hack to prevent recursion */
 		if(shi->shading.nodes==0 && shi->material.mat->nodetree && shi->material.mat->use_nodes) {
 			ntreeShaderExecTree(shi->material.mat->nodetree, re, shi, shr);
 			shi->material.mat= vlr->mat;		/* shi->material.mat is being set in nodetree */
 		}
 		else
-			shade_color(re, shi, shr);
+#endif
+
+		shade_color(re, shi, shr);
 	}
 	else {
 		if(shi->material.mat->nodetree && shi->material.mat->use_nodes) {

Modified: branches/render25/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- branches/render25/source/blender/render/intern/source/shadeoutput.c	2010-03-18 17:41:18 UTC (rev 27606)
+++ branches/render25/source/blender/render/intern/source/shadeoutput.c	2010-03-18 18:19:49 UTC (rev 27607)
@@ -67,12 +67,21 @@
 {
 	ShadeMaterial *smat= &shi->material;
 
-	mat_shading_begin(re, shi, smat, 1);
+	/* only used for transparent shadows so we can do this
+	   optimization, code will be moved later to make this
+	   more clear */
+	if(smat->mat->mode & MA_TRANSP) {
+		mat_shading_begin(re, shi, smat, 1);
 
-	mat_color(shr->diff, smat);
-	shr->alpha= mat_alpha(smat);
+		mat_color(shr->diff, smat);
+		shr->alpha= mat_alpha(smat);
 
-	mat_shading_end(re, smat);
+		mat_shading_end(re, smat);
+	}
+	else {
+		zero_v3(shr->diff);
+		shr->alpha= 1.0f;
+	}
 }
 
 /*********************************** Ramps ***********************************/





More information about the Bf-blender-cvs mailing list