mirror of https://github.com/bjornbytes/lovr.git
Fix mipmaps with nearest filtering;
This commit is contained in:
parent
85ee89d36f
commit
a2cb611b6c
|
@ -1932,8 +1932,13 @@ void lovrTextureSetFilter(Texture* texture, TextureFilter filter) {
|
||||||
|
|
||||||
switch (filter.mode) {
|
switch (filter.mode) {
|
||||||
case FILTER_NEAREST:
|
case FILTER_NEAREST:
|
||||||
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
if (texture->mipmaps) {
|
||||||
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||||
|
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
} else {
|
||||||
|
glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FILTER_BILINEAR:
|
case FILTER_BILINEAR:
|
||||||
|
|
Loading…
Reference in New Issue