[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41918] trunk/blender/source/blender/ render/intern/source/render_texture.c: Fix #29093: world zenith up and down texture influence were not working

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Nov 16 16:47:26 CET 2011


Revision: 41918
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41918
Author:   blendix
Date:     2011-11-16 15:47:25 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
Fix #29093: world zenith up and down texture influence were not working
correct. These were decoupled from horizon influence for 2.5, but not
actually used in the render engine.

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

Modified: trunk/blender/source/blender/render/intern/source/render_texture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/render_texture.c	2011-11-16 14:36:23 UTC (rev 41917)
+++ trunk/blender/source/blender/render/intern/source/render_texture.c	2011-11-16 15:47:25 UTC (rev 41918)
@@ -3007,7 +3007,7 @@
 	TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
 	float *co, fact, stencilTin=1.0;
 	float tempvec[3], texvec[3], dxt[3], dyt[3];
-	int tex_nr, rgb= 0, ok;
+	int tex_nr, rgb= 0;
 	
 	if (R.r.scemode & R_NO_TEX) return;
 	/* todo: add flag to test if there's a tex */
@@ -3171,18 +3171,21 @@
 					texture_rgb_blend(hor, tcol, hor, texres.tin, mtex->colfac, mtex->blendtype);
 				}
 				if(mtex->mapto & (WOMAP_ZENUP+WOMAP_ZENDOWN)) {
-					ok= 0;
+					float zenfac = 0.0f;
+
 					if(R.wrld.skytype & WO_SKYREAL) {
 						if((skyflag & WO_ZENUP)) {
-							if(mtex->mapto & WOMAP_ZENUP) ok= 1;
+							if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
 						}
-						else if(mtex->mapto & WOMAP_ZENDOWN) ok= 1;
+						else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
 					}
-					else ok= 1;
+					else {
+						if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac;
+						else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac;
+					}
 					
-					if(ok) {
-						texture_rgb_blend(zen, tcol, zen, texres.tin, mtex->colfac, mtex->blendtype);
-					}
+					if(zenfac != 0.0f)
+						texture_rgb_blend(zen, tcol, zen, texres.tin, zenfac, mtex->blendtype);
 				}
 			}
 			if(mtex->mapto & WOMAP_BLEND) {




More information about the Bf-blender-cvs mailing list