Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-04-27 18:14:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-27 18:18:50 +0300
commit84db9fdf4dd3bb5e1ddd6c2884787033386ac2ca (patch)
tree08add31e64e4da8d1a9c7791a202350c8709ba12 /source
parent8d8d1939fab72cee068be81dac84679cac42cee6 (diff)
Fix T44464: Viewport mipmaps no longer toggle off
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c26
-rw-r--r--source/creator/creator.c1
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp15
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)