且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android OpenGL:可能内存不足?

更新时间:2023-01-14 14:25:30

正确的解决方案是texture压缩,而不是PNG压缩.PVR-TC 可以满足您的大部分需求.在 4-bpp 时,您将降至 12MB 而不是 117MB.即使只使用较低位深度的图像,例如 RGB-565 格式(每像素 16 位),您的需求也会减少一半.

The correct solution is texture compression, not PNG compression. PVR-TC would get you most of what you need. At 4-bpp, you'd go down to 12MB instead of 117MB. Even just using lower bitdepth images, like RGB-565 formats, (16-bits per pixel) would cut your needs in half.

此外,您不必为手机使用 1024x1024 纹理;这有点矫枉过正.您可能会使用 512x512 图像而侥幸逃脱.再加上 PVR-TC,您只需要大约 3MB 即可存储所有纹理数据.

Also, you don't have to use 1024x1024 textures for phones; that's kind of overkill. You could probably get away with 512x512 images. Coupled with PVR-TC, you'd only need about 3MB for all of that texture data.