libgdx texture filters and mipmap

后端 未结 4 1610
慢半拍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:17

    I had this same problem, and the fix turned out to be insanely simple. When you create a Texture, you need to specify that it uses mipmaps.

    All you have to do is pass a second parameter to the Texture constructor like this:

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

    You can view all the Texture class constructors in the API docs here: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Texture.html

提交回复
热议问题