libgdx texture filters and mipmap

后端 未结 4 1551
慢半拍i
慢半拍i 2021-01-12 05:34

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. In

4条回答
  •  再見小時候
    2021-01-12 06:12

    Just like Mitesh said in his answer mipmaps filters doesn't work because you are not telling Libgdx to generate mipmaps.

    if you are using assets manager the code will be something like this

     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);
    

提交回复
热议问题