gpt4 book ai didi

android - Libgdx - 使用 MipMaps

转载 作者:行者123 更新时间:2023-11-30 01:19:01 24 4
gpt4 key购买 nike

TextureLoader.TextureParameter param = new TextureLoader.TextureParameter();
param.minFilter = Texture.TextureFilter.MipMapLinearNearest;
param.magFilter = Texture.TextureFilter.Nearest;
param.genMipMaps = true;

manager.load("MainMenu.pack", TextureAtlas.class);

manager.load("GameScreen/player.png", Texture.class, param);
manager.load("GameScreen/obstacle.png", Texture.class, param);
manager.load("GameScreen/star.png", Texture.class, param);

MainMenu 还在 .pack 文件中设置了过滤器。

现在这一切都是自动完成的吗?或者我是否必须手动告诉应用程序使用 mipmap,我可能必须这样做,但我该怎么做?

最佳答案

由于official LibGDX wiki :

When opting to use mipmaps, the Texture will create them at instantiation time. MipMaps are pre-calculated, optimized resized copies of the same image to save on computation time when resizing the texture to fit a rectangle. Smaller (halved) copies of the same image are created and uploaded to the GPU and used for different sized geometries instead of being shrunk on the fly. It adds to memory consumption but makes rendering faster.

是的 - 它们是自动生成的。

关于android - Libgdx - 使用 MipMaps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37389148/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com