[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13035] trunk/blender/source/blender: And there's another annoyance I got poked for:

Ton Roosendaal ton at blender.org
Fri Dec 28 19:58:40 CET 2007


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

Log Message:
-----------
And there's another annoyance I got poked for:

Image texture "Filter size" was not well usable for making the
appearance soft filtered, this because it multiplied the sample 
values, and such values could be extreme small.

Added next to "Filter" buton a new "Min" option, which enforces
a filter size to be a minimum of 'filter' pixels in size.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_texture_types.h
    trunk/blender/source/blender/render/intern/source/imagetexture.c
    trunk/blender/source/blender/src/buttons_shading.c

Modified: trunk/blender/source/blender/makesdna/DNA_texture_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_texture_types.h	2007-12-28 17:10:55 UTC (rev 13034)
+++ trunk/blender/source/blender/makesdna/DNA_texture_types.h	2007-12-28 18:58:40 UTC (rev 13035)
@@ -248,6 +248,7 @@
 #define TEX_CALCALPHA	32
 #define TEX_NORMALMAP	2048
 #define TEX_GAUSS_MIP	4096
+#define TEX_FILTER_MIN	8192
 
 /* imaflag unused, only for version check */
 #define TEX_FIELDS_		8

Modified: trunk/blender/source/blender/render/intern/source/imagetexture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/imagetexture.c	2007-12-28 17:10:55 UTC (rev 13034)
+++ trunk/blender/source/blender/render/intern/source/imagetexture.c	2007-12-28 18:58:40 UTC (rev 13035)
@@ -702,6 +702,15 @@
 	minx= tex->filtersize*(maxx-minx)/2.0f;
 	miny= tex->filtersize*(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) */
+	 	float addval= (0.5f * tex->filtersize) / (float) MIN2(ibuf->x, ibuf->y);
+ 		
+		if(addval > minx)
+			minx= addval;
+		if(addval > miny)
+			miny= addval;
+	}
 	if(tex->filtersize!=1.0f) {
 		dxt[0]*= tex->filtersize;
 		dxt[1]*= tex->filtersize;

Modified: trunk/blender/source/blender/src/buttons_shading.c
===================================================================
--- trunk/blender/source/blender/src/buttons_shading.c	2007-12-28 17:10:55 UTC (rev 13034)
+++ trunk/blender/source/blender/src/buttons_shading.c	2007-12-28 18:58:40 UTC (rev 13035)
@@ -1244,9 +1244,10 @@
 	uiDefButBitS(block, TOG, TEX_USEALPHA, B_TEXPRV, "UseAlpha",	10, 160, 100, 20, &tex->imaflag, 0, 0, 0, 0, "Click to use Image's alpha channel");
 	uiDefButBitS(block, TOG, TEX_CALCALPHA, B_TEXPRV, "CalcAlpha",	110, 160, 100, 20, &tex->imaflag, 0, 0, 0, 0, "Click to calculate an alpha channel based on Image RGB values");
 	uiDefButBitS(block, TOG, TEX_NEGALPHA, B_TEXPRV, "NegAlpha",	210, 160, 100, 20, &tex->flag, 0, 0, 0, 0, "Click to invert the alpha values");
-	uiBlockEndAlign(block);
 
-	uiDefButF(block, NUM, B_TEXPRV, "Filter :",						10,120,150,20, &tex->filtersize, 0.1, 25.0, 10, 3, "Sets the filter size used by mipmap and interpol");
+	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");
 	
 	uiBlockBeginAlign(block);
 	uiDefButBitS(block, TOG, TEX_NORMALMAP, B_NOP, "Normal Map",	160,120,(mtex)? 75: 150,20, &tex->imaflag,





More information about the Bf-blender-cvs mailing list