Android 图形内存限制
我正在使用 opengl 和 cocos2d 端口(http://code.google.com/p/cocos2d-android-1)创建一个 android 游戏。我的目标是广泛的设备,并希望确保其性能良好。我只在 Nexus 上进行测试,希望能从在较慢设备上有经验的人那里得到一些意见。
目前游戏使用两个 1024x1024 纹理以及两个 256x256 纹理。这在大多数设备的限制范围内吗?在这些情况下,有人对图形内存限制有任何经验法则或经验吗?如果 gfx 内存超出,它是否会分页到正常内存?
I am creating an android game using opengl and a cocos2d port (http://code.google.com/p/cocos2d-android-1). I am targeting a wide range of devices and want to ensure that it performs well. I only test on a nexus one and am hoping to get some input from people with experience on slower devices.
Currently the game uses two 1024x1024 textures as well as two 256x256 textures. Is this within the limits of most devices? Anyone have any rule of thumb or experience with graphics memory limits in these cases? If gfx memory is exceeded does it page to normal memory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Java 应用程序为 16Mo (mdpi) 或 24Mo (hdpi)。但 Native 不是,OpenGL Java API 只是 JNI 包装器。因此您可以在 GPU 上加载超过 24Mo 的纹理。我的经验是一开始将 Atlas 限制在 512*512(因为 G1 在大纹理上速度很慢),但今天我使用更大的 Atlas 纹理。
我们当前的游戏使用 20-50 Mo 的内存并使用 2048*2048 纹理。
Java Apps are 16Mo (mdpi) or 24Mo (hdpi). But Native aren't and OpenGL Java API is only a JNI wrapper. So you can load on GPU more than 24Mo of texture. My experience was to limit Atlas at 512*512 at first (because G1 was slow on big textures) but today i use bigger atlas texture.
Our current games use 20-50 Mo of ram and use 2048*2048 textures.
我知道旧帖子,但现在您在 VM 中谈论至少 128mb,以便使用 android java 内存中位图的可用加载空间。
使用纹理时,您将在应用程序空间之外加载 (c)。所以加载限制与手机内存相同。 (您会注意到,在内存密集型游戏中,返回主屏幕时会绘制图标)
Old post I know but nowadays your talking at least 128mb in the VM for available loading space on Bitmaps in memory using android java.
With textures you are loading outside the app space (c). So the loading limit is the same as the phones memory. (You'll notice on memory intensive games that the icons draw when going back to the home screen)
据我所知,纹理的内存限制与应用程序的内存限制相同,我相信在大多数情况下为 16 兆,尽管它可能是所有可访问的可用手机内存。
在遇到问题之前,我已经在应用程序中加载了比这更多的内容,至少有一个 2048x2048 纹理和几个 512x512 纹理,内存中都是 8888。
我从来没有在纹理绑定上遇到过 oom 错误,只在加载位图时遇到过错误,所以我希望这会有所帮助。
Afaik the Memory Limits for textures are the same as the memory limits of your app, which is 16 megs in most situations I believe, although it might be all available phone memory that's accessible.
I've loaded MUCH more than this into my apps before I ran into problems, at least one 2048x2048 texture and several 512x512 textures, all 8888 in memory.
I've never had a oom error on texture binding, only on loading bitmaps, so I hope that helps.