diff options
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 26 | ||||
-rw-r--r-- | source/creator/creator.c | 1 | ||||
-rw-r--r-- | source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp | 15 |
3 files changed, 28 insertions, 14 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index a31e90f0dfe..a24067fc381 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -239,8 +239,12 @@ static struct GPUTextureState { int curtileYRep, tileYRep; Image *ima, *curima; - bool domipmap, linearmipmap; - bool texpaint; /* store this so that new images created while texture painting won't be set to mipmapped */ + /* also controls min/mag filtering */ + bool domipmap; + /* only use when 'domipmap' is set */ + bool linearmipmap; + /* store this so that new images created while texture painting won't be set to mipmapped */ + bool texpaint; int alphablend; float anisotropic; @@ -292,7 +296,6 @@ void GPU_set_mipmap(bool mipmap) void GPU_set_linear_mipmap(bool linear) { if (GTS.linearmipmap != linear) { - GPU_free_images(); GTS.linearmipmap = linear; } } @@ -312,18 +315,23 @@ static GLenum gpu_get_mipmap_filter(bool mag) /* linearmipmap is off by default *when mipmapping is off, * use unfiltered display */ if (mag) { - if (GTS.linearmipmap || GTS.domipmap) + if (GTS.domipmap) return GL_LINEAR; else return GL_NEAREST; } else { - if (GTS.linearmipmap) - return GL_LINEAR_MIPMAP_LINEAR; - else if (GTS.domipmap) - return GL_LINEAR_MIPMAP_NEAREST; - else + if (GTS.domipmap) { + if (GTS.linearmipmap) { + return GL_LINEAR_MIPMAP_LINEAR; + } + else { + return GL_LINEAR_MIPMAP_NEAREST; + } + } + else { return GL_NEAREST; + } } } diff --git a/source/creator/creator.c b/source/creator/creator.c index d86ccd657d4..721e43cda4d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1024,6 +1024,7 @@ static int set_ge_parameters(int argc, const char **argv, void *data) } /* linearMipMap */ if (STREQ(argv[a], "linearmipmap")) { + GPU_set_mipmap(1); GPU_set_linear_mipmap(1); //linearMipMap = 1; } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp index f47f56541ba..95c153a7e2a 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp @@ -1074,12 +1074,17 @@ void RAS_OpenGLRasterizer::SetMipmapping(MipmapOption val) RAS_IRasterizer::MipmapOption RAS_OpenGLRasterizer::GetMipmapping() { - if (GPU_get_linear_mipmap()) - return RAS_IRasterizer::RAS_MIPMAP_LINEAR; - else if (GPU_get_mipmap()) - return RAS_IRasterizer::RAS_MIPMAP_NEAREST; - else + if (GPU_get_mipmap()) { + if (GPU_get_linear_mipmap()) { + return RAS_IRasterizer::RAS_MIPMAP_LINEAR; + } + else { + return RAS_IRasterizer::RAS_MIPMAP_NEAREST; + } + } + else { return RAS_IRasterizer::RAS_MIPMAP_NONE; + } } void RAS_OpenGLRasterizer::SetUsingOverrideShader(bool val) |