diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-22 02:53:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-22 04:51:06 +0300 |
commit | fe2ff3fc89332ddf8374b72e2f05f3f7015f8cbd (patch) | |
tree | 5e19127252674e2ea98ad592748535c2afe101f1 /source/blender/gpu/intern/gpu_texture.c | |
parent | 4ceb006706579a0ad2301d2cde57489b69a7683c (diff) |
GPUTexture: Support for nearest sampling with mipmaps.
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index 3ac1571bf82..a8d0dccb896 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -856,7 +856,7 @@ void GPU_texture_filter_mode(GPUTexture *tex, bool use_filter) glActiveTexture(GL_TEXTURE0); } -void GPU_texture_mipmap_mode(GPUTexture *tex, bool use_mipmap) +void GPU_texture_mipmap_mode(GPUTexture *tex, bool use_mipmap, bool use_filter) { if (tex->number >= GPU_max_textures()) { fprintf(stderr, "Not enough texture slots.\n"); @@ -869,7 +869,9 @@ void GPU_texture_mipmap_mode(GPUTexture *tex, bool use_mipmap) if (tex->number != 0) glActiveTexture(GL_TEXTURE0 + tex->number); - GLenum mipmap = use_mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR; + GLenum mipmap = (use_filter) + ? use_mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR + : use_mipmap ? GL_NEAREST_MIPMAP_LINEAR : GL_NEAREST; glTexParameteri(tex->target_base, GL_TEXTURE_MIN_FILTER, mipmap); if (tex->number != 0) |