Libgdx and mipmap texture filters

When I try to use mipmap filtering in LibGDX, none of the images appear.

I'm new to LibGDX, and I have a simple 2d scene with three rotating, scaled circles. To smooth them, I wanted to use linear filtering. For reference, I looked at this article , which said that for highly scaled images, mipmap can be used to increase speed and quality.

The first unexpected appearance was that although all my images were scaled down, I would only see a linear filter if magFilter was linear. In other words:

This code will show a linear filter for thumbnails:

parentTexture.setFilter(TextureFilter.Nearest, TextureFilter.Linear);

whlie this code will not:

parentTexture.setFilter(TextureFilter.Linear, TextureFilter.Nearest);

which seems to be the opposite of the libGDX function:

void com.badlogic.gdx.graphics.Texture.setFilter(TextureFilter minFilter, TextureFilter magFilter)

, , , libgdx (), (), . , mipmap.

.

parentTexture.setFilter(TextureFilter.MipMapLinearLinear, TextureFilter.Linear);

,

parentTexture.setFilter(TextureFilter.Linear, TextureFilter.MipMapLinearLinear);

, , . , libGDX , , .

+5
4

, . Texture, , mipmaps.

, , Texture :

Texture myTexture = new Texture(Gdx.files.internal("myImage.png"), true);

Texture API : http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Texture.html

+6

, , mipmaps , Libgdx mipmaps.

, -

 TextureParameter param = new TextureParameter();
 param.genMipMaps = true; // enabling mipmaps

 manager.load("path/to/texfile.png", Texture.class, param);

 Texture tex = manager.get("path/to/texfile.png", Texture.class);
 tex.setFilter(TextureFilter.MipMap, TextureFilter.Nearest);
+3

:

  • 2, 354X420, . 512X512 2.

  • Mipmap, boolean genMipMaps, libgdx, mapmap.

+1

Try using the same minFilter and maxFilter. I had a similar problem and if I TextureFilter.Linear, TextureFilter.Linear or both MipMap the problem is resolved. Hope this helps.

0
source

All Articles