[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53178] trunk/blender/source/blender/ editors/interface/interface_icons.c: UI DPI: use a sharper filter when scaling icons, when the scale matches a mipmap

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Dec 19 13:51:46 CET 2012


Revision: 53178
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53178
Author:   blendix
Date:     2012-12-19 12:51:43 +0000 (Wed, 19 Dec 2012)
Log Message:
-----------
UI DPI: use a sharper filter when scaling icons, when the scale matches a mipmap
level, this has no effect, it's for the zoom levels in between. There's a
tradeoff here between blurring and aliasing, I think this looks better.

Before: http://www.pasteall.org/pic/show.php?id=42090
After: http://www.pasteall.org/pic/show.php?id=42091

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_icons.c

Modified: trunk/blender/source/blender/editors/interface/interface_icons.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_icons.c	2012-12-19 12:30:39 UTC (rev 53177)
+++ trunk/blender/source/blender/editors/interface/interface_icons.c	2012-12-19 12:51:43 UTC (rev 53178)
@@ -958,6 +958,9 @@
 	glEnable(GL_TEXTURE_2D);
 	glBindTexture(GL_TEXTURE_2D, icongltex.id);
 
+	/* sharper downscaling, has no effect when scale matches with a mip level */
+	glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, -0.5f);
+
 	glBegin(GL_QUADS);
 	glTexCoord2f(x1, y1);
 	glVertex2f(x, y);
@@ -972,6 +975,8 @@
 	glVertex2f(x, y + h);
 	glEnd();
 
+	glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, 0.0f);
+
 	glBindTexture(GL_TEXTURE_2D, 0);
 	glDisable(GL_TEXTURE_2D);
 }




More information about the Bf-blender-cvs mailing list