[Bf-blender-cvs] [ea79dce] master: Fix T37468: image empties now use no interpolation when mipmaps are disabled.
Brecht Van Lommel
noreply at git.blender.org
Mon Nov 18 11:29:26 CET 2013
Commit: ea79dcebe2303b0b58a0791cd8b531ecc45a2394
Author: Brecht Van Lommel
Date: Mon Nov 18 11:26:37 2013 +0100
http://developer.blender.org/rBea79dcebe2303b0b58a0791cd8b531ecc45a2394
Fix T37468: image empties now use no interpolation when mipmaps are disabled.
Image empties don't actually support mipmaps right now, but the user preference
doubles as a way to disable any kind of interpolating in texture filter and just
show nearest neighbour filter, so for this is a bit more consistent.
===================================================================
M source/blender/editors/space_view3d/drawobject.c
===================================================================
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 3ed1d15..2083da2 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -610,6 +610,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char
if (ibuf && ibuf->rect) {
const bool use_clip = (U.glalphaclip != 1.0f);
+ int zoomfilter = (U.gameflags & USER_DISABLE_MIPMAP )? GL_NEAREST : GL_LINEAR;
/* Setup GL params */
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -623,7 +624,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char
glColor4fv(ob->col);
/* Draw the Image on the screen */
- glaDrawPixelsTex(ofs_x, ofs_y, ima_x, ima_y, GL_RGBA, GL_UNSIGNED_BYTE, GL_LINEAR, ibuf->rect);
+ glaDrawPixelsTex(ofs_x, ofs_y, ima_x, ima_y, GL_RGBA, GL_UNSIGNED_BYTE, zoomfilter, ibuf->rect);
glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
glDisable(GL_BLEND);
More information about the Bf-blender-cvs
mailing list