[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33014] trunk/blender/source/blender/ render/intern/source/texture.c: Bugfix #20027

Ton Roosendaal ton at blender.org
Thu Nov 11 17:50:04 CET 2010


Revision: 33014
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33014
Author:   ton
Date:     2010-11-11 17:50:04 +0100 (Thu, 11 Nov 2010)

Log Message:
-----------
Bugfix #20027

Texture Nodes didn't work for normal output anymore anymore.
It was caused by new handling of bump code using derivatives,
but that's not how texture nodes work now. In case a texture
has nodes, it uses the old (2.4) method.

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

Modified: trunk/blender/source/blender/render/intern/source/texture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/texture.c	2010-11-11 15:33:28 UTC (rev 33013)
+++ trunk/blender/source/blender/render/intern/source/texture.c	2010-11-11 16:50:04 UTC (rev 33014)
@@ -1667,7 +1667,7 @@
 	float texvec[3], dxt[3], dyt[3], tempvec[3], norvec[3], warpvec[3]={0.0f, 0.0f, 0.0f}, Tnor=1.0;
 	int tex_nr, rgbnor= 0, warpdone=0;
 	float nu[3] = {0,0,0}, nv[3] = {0,0,0}, nn[3] = {0,0,0}, dudnu = 1.f, dudnv = 0.f, dvdnu = 0.f, dvdnv = 1.f; // bump mapping
-	int nunvdone= 0;
+	int nunvdone= 0, newbump;
 
 	if (R.r.scemode & R_NO_TEX) return;
 	/* here: test flag if there's a tex (todo) */
@@ -1683,6 +1683,9 @@
 			tex= mtex->tex;
 			if(tex==0) continue;
 
+			/* XXX texture node trees don't work for this yet */
+			newbump= (mtex->texflag & MTEX_NEW_BUMP) && !(tex->nodetree && tex->use_nodes);
+			
 			/* which coords */
 			if(mtex->texco==TEXCO_ORCO) {
 				if(mtex->texflag & MTEX_DUPLI_MAPTO) {
@@ -1844,7 +1847,8 @@
 				co= tempvec;
 			}
 
-			if(mtex->texflag & MTEX_NEW_BUMP) {
+			/* XXX texture node trees don't work for this yet */
+			if(newbump) {
 				// compute ortho basis around normal
 				if(!nunvdone) {
 					// render normal is negated
@@ -2169,7 +2173,8 @@
 						}
 					}
 					else {
-						if (mtex->texflag & MTEX_NEW_BUMP) {
+						/* XXX texture node trees don't work for this yet */
+						if (newbump) {
 							shi->vn[0] = texres.nor[0];
 							shi->vn[1] = texres.nor[1];
 							shi->vn[2] = texres.nor[2];





More information about the Bf-blender-cvs mailing list