有没有办法忽略libgdx图像限制? (图片必须是2的幂) [英] Is there any way to ignore libgdx images Limitation? (images must be power of two)

查看:210
本文介绍了有没有办法忽略libgdx图像限制? (图片必须是2的幂)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

libgdx框架我们只能用图像幂( 64x256 128×32 等),因为OpenGL需要它。

In libgdx framework we can only use images power of two (64x256, 128x32, etc) Because OpenGL requires it.

有没有通行证这种限制没有什么好的办法?结果例如:使用图像 800×480

Is there any good way to "pass" this limitation?
For example: Use images 800x480.

推荐答案

您可以使用非锅纹理,例如使用的OpenGL ES2.0。但它是很好的做法,至少试着用锅纹理。例如,通过打包多个图像到一个单一的纹理。这也减少了纹理开关的量。参见:<一href=\"http://$c$c.google.com/p/libgdx/wiki/TexturePacker\">http://$c$c.google.com/p/libgdx/wiki/TexturePacker.

You can use non pot textures, e.g. by using opengl es2.0. But it is good practice to at least try to use pot textures. For example by packing multiple images into a single texture. This also reduces the amount of texture switches. See: http://code.google.com/p/libgdx/wiki/TexturePacker.

这篇关于有没有办法忽略libgdx图像限制? (图片必须是2的幂)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆