Android 中合理的纹理大小
我正在尝试开发一个在 android 上使用 opengl 的应用程序,并且理想情况下使其可以在与原始 droid 一样古老的任何手机上运行(或者至少在任何支持 OpenGL ES 2.0 的手机上运行)。目前,我使用 2048x2048 ETC1 纹理压缩。它在我正在测试的 Droid X 上运行良好,但我目前没有原始的 droid 来测试它,而且我也找不到关于这个主题的太多数据。我知道 G1 不能很好地处理大于 512x512 的纹理,而 droid 似乎可以很好地处理大到 1024x1024 的图像,但是 2048x2048 呢? (同样,etc1 压缩,因此大约有 2 MB 大)。另外,由于 ETC1 不支持 Alpha,我想加载另一个 ETC1 纹理来支持 Alpha 通道。这是一个白日梦吗?
基本上,我想知道在不早于原始机器人的 Android 手机中需要多少空间来加载纹理数据,至少在整个过程不会大幅减慢的情况下。
I'm trying to develop an app that uses opengl on android, and ideally make it run on any phone as old as the original droid (or at least any phone that has OpenGL ES 2.0 support). Currently, I'm using a 2048x2048 ETC1 texture compression. It works fine on the Droid X I'm testing it on, but I currently don't have an original droid to test it on, and I can't find much data on this topic either. I know the G1 didn't do well with textures bigger than 512x512, and the droid seems to do fine with images as large as 1024x1024, but what about 2048x2048? (Again, etc1 compression, so it's about 2 MB large). Also, because ETC1 doesn't support alpha, I would like to load up another ETC1 texture to support an alpha channel. Is this a pipe dream?
Basically, I would like to know how much space I have to load texture data in android phones no older than the original droid, at least without the whole thing slowing down drastically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查询 MAX_TEXTURE_SIZE 来获取最大纹理尺寸,也可以在 http://glbenchmark.com 上查找您的手机(您可以找到 Droid 信息 此处)。 AFAIK,G1 不支持 GLES 2.0。
加载多个纹理肯定会起作用,尤其是当每个纹理不超过 2 MB 时。但您当然会受到可用内存大小的限制。
另外,为了获得最佳性能,您应该对纹理进行 mipmap。由于您使用的是 ETC,因此必须离线完成此操作。
有关如何将 ETC1 与 alpha 版本结合使用的指南,请参阅此处 。
You can query the MAX_TEXTURE_SIZE to get the maximum texture size, or you can look up your phone on http://glbenchmark.com (you can find the Droid info here). The G1 did not support GLES 2.0, AFAIK.
Loading up several textures should definitly work, especially when they are not more than 2 MB each. But you will of course be restricted by the size of the memory available.
Also, to have optimal performance you should mipmap your textures. Since you are using ETC, this must be done offline.
For a guide to how to use ETC1 with alpha, see here.