diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-19 16:51:43 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-19 16:51:43 +0400 |
commit | ec85a4370f1a24ea50a547e7104db299665315c2 (patch) | |
tree | 552ab1acf50a9b8b6cf89392786d257d18f77ef1 /source | |
parent | cdb6aad54c3962b144fa2ed02d9d70a037ab0936 (diff) |
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
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 7240477737d..2928a5607c0 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -958,6 +958,9 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy 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 @@ static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy 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); } |