I have a problem that has been torturing me for a month, and maybe more. There is a large background of about 9000x13000
pixels. And I am trying to bring this background to the screen. Since my video card only supports textures with a resolution of not more than 8192x8192
pixels, a black area is displayed instead of the texture. I compressed the image to 5000x7000
pixels. Now it is displayed, but the FPS has fallen to 50
(except for one image there is nothing). In addition, the game is also designed to work on mobile devices, and there the limitations of video cards can be 2048x2048
textures, and maybe less. I tried to break my big texture into 117 pieces (each not more than 1024x1024 pixels) and pull them one after another. Now the load of the game is about a minute and when the textures are output the FPS drops to 5
! I tried to use filters
texture.setFilter(
Texture.TextureFilter.MipMapNearestNearest,
Texture.TextureFilter.Nearest
);
but the FPS did not go above 10. It also set the useMipMap flag to true when loading. At the moment I'm doing this:
Texture texture=new Texture(file, true);
texture.setFilter(
Texture.TextureFilter.MipMapNearestNearest,
Texture.TextureFilter.Nearest
);
public void render()
{
batch.begin();
batch.draw(texture,0,0,Gdx.graphics.getScreenWidth(),Gdx.graphics.getScreenHeight());
batch.end();
}
Tell me, how can I optimize the output of a large texture? This texture is a map, so when approaching large screens it should be clearly detailed.
I will be grateful for any help