[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13036] trunk/blender/source/blender: Error in previous commit: the texture filter size should not be scaled

Ton Roosendaal ton at blender.org
Fri Dec 28 20:38:48 CET 2007


Revision: 13036
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13036
Author:   ton
Date:     2007-12-28 20:38:47 +0100 (Fri, 28 Dec 2007)

Log Message:
-----------
Error in previous commit: the texture filter size should not be scaled
at all if you use new 'minimal' option. The new option works much nicer
if it only sets the minimum. (use texture with 'refl' map)

Added option to env map too!

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

Modified: trunk/blender/source/blender/render/intern/source/imagetexture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/imagetexture.c	2007-12-28 18:58:40 UTC (rev 13035)
+++ trunk/blender/source/blender/render/intern/source/imagetexture.c	2007-12-28 19:38:47 UTC (rev 13036)
@@ -699,8 +699,8 @@
 	maxy= MAX3(dxt[1],dyt[1],dxt[1]+dyt[1] );
 
 	/* tex_sharper has been removed */
-	minx= tex->filtersize*(maxx-minx)/2.0f;
-	miny= tex->filtersize*(maxy-miny)/2.0f;
+	minx= (maxx-minx)/2.0f;
+	miny= (maxy-miny)/2.0f;
 	
 	if(tex->imaflag & TEX_FILTER_MIN) {
 		/* make sure the filtersize is minimal in pixels (normal, ref map can have miniature pixel dx/dy) */
@@ -711,7 +711,10 @@
 		if(addval > miny)
 			miny= addval;
 	}
-	if(tex->filtersize!=1.0f) {
+	else if(tex->filtersize!=1.0f) {
+		minx*= tex->filtersize;
+		miny*= tex->filtersize;
+		
 		dxt[0]*= tex->filtersize;
 		dxt[1]*= tex->filtersize;
 		dyt[0]*= tex->filtersize;

Modified: trunk/blender/source/blender/render/intern/source/texture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/texture.c	2007-12-28 18:58:40 UTC (rev 13035)
+++ trunk/blender/source/blender/render/intern/source/texture.c	2007-12-28 19:38:47 UTC (rev 13036)
@@ -98,7 +98,7 @@
 	}
 	else if(tex->type==TEX_ENVMAP) {
 		/* just in case */
-		tex->imaflag= TEX_INTERPOL | TEX_MIPMAP;
+		tex->imaflag |= TEX_INTERPOL | TEX_MIPMAP;
 		tex->extend= TEX_CLIP;
 		
 		if(tex->env) {

Modified: trunk/blender/source/blender/src/buttons_shading.c
===================================================================
--- trunk/blender/source/blender/src/buttons_shading.c	2007-12-28 18:58:40 UTC (rev 13035)
+++ trunk/blender/source/blender/src/buttons_shading.c	2007-12-28 19:38:47 UTC (rev 13036)
@@ -1247,7 +1247,7 @@
 
 	uiBlockBeginAlign(block);
 	uiDefButBitS(block, TOG, TEX_FILTER_MIN, B_TEXPRV, "Min",	10, 120, 30, 20, &tex->imaflag, 0, 0, 0, 0, "Use Filtersize as a minimal filter value in pixels");
-	uiDefButF(block, NUM, B_TEXPRV, "Filter: ",					40,120,120,20, &tex->filtersize, 0.1, 25.0, 10, 3, "Multiplies the filter size used by mipmap and interpol");
+	uiDefButF(block, NUM, B_TEXPRV, "Filter: ",					40,120,120,20, &tex->filtersize, 0.1, 50.0, 10, 3, "Multiplies the filter size used by mipmap and interpol");
 	
 	uiBlockBeginAlign(block);
 	uiDefButBitS(block, TOG, TEX_NORMALMAP, B_NOP, "Normal Map",	160,120,(mtex)? 75: 150,20, &tex->imaflag,
@@ -1369,7 +1369,8 @@
 			uiDefButS(block, NUM, B_ENV_FREE, 	"CubeRes", 		160,90,150,20, &env->cuberes, 50, 4096.0, 0, 0, "Sets the pixel resolution of the rendered environment map");
 		
 		uiBlockBeginAlign(block);
-		uiDefButF(block, NUM, B_TEXPRV, "Filter :",				10,65,150,20, &tex->filtersize, 0.1, 25.0, 0, 3, "Adjusts sharpness or blurriness of the reflection"),
+		uiDefButBitS(block, TOG, TEX_FILTER_MIN, B_TEXPRV, "Min",	10, 65, 30, 20, &tex->imaflag, 0, 0, 0, 0, "Use Filtersize as a minimal filter value in pixels");
+		uiDefButF(block, NUM, B_TEXPRV, "Filter :",					40,65,120,20, &tex->filtersize, 0.1, 25.0, 0, 3, "Adjusts sharpness or blurriness of the reflection"),
 			uiDefButS(block, NUM, B_ENV_FREE, "Depth:",				160,65,150,20, &env->depth, 0, 5.0, 0, 0, "Sets the number of times a map will be rendered recursively mirror effects"),
 			uiDefButF(block, NUM, REDRAWVIEW3D, 	"ClipSta", 		10,40,150,20, &env->clipsta, 0.01, 50.0, 100, 0, "Sets start value for clipping: objects nearer than this are not visible to map");
 		uiDefButF(block, NUM, B_NOP, 	"ClipEnd", 					160,40,150,20, &env->clipend, 0.1, 20000.0, 1000, 0, "Sets end value for clipping beyond which objects are not visible to map");





More information about the Bf-blender-cvs mailing list