FPS放缓显著逐帧动画使用帧时 [英] FPS slowing down significantly when using frame by frame animation

查看:158
本文介绍了FPS放缓显著逐帧动画使用帧时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Flash CS5和AS3开发游戏为Android平台。

问题:游戏将运行在24-29 fps在我所说的视频剪辑有一帧一帧的动画,然后将下降到10-14 FPS。 它看起来完美的我的电脑上,并不会失去帧,直到我将它移动到我的埃沃进行测试。我曾在一个史诗般的测试也和我不会失去框架这使我相信,这是pixil人口是导致问题的EVO但我已经尝试了所有我能想到的也不是真的对图形强烈但相同的结果每一次。

这是一个20帧动画和我的闪光灯FPS设置为24

我曾尝试:

巴新方在每一帧| GIF的每一帧| 每幅图像的每一帧钢笔工具矢量绘图| 吐温不是逐帧| 在影片剪辑中的静态图像和AS3创建一个循环,将循环图像| 的onEnterFrame |

这实际上并使其光滑正在对每一帧图像相同的唯一的事。这就是为什么我相信这是显卡,而不是处理器。

  **基准的PC:**
FPS:24/24
FPS动画期间:24/24

MS:33
MS动画期间:33

内存:18.87
存储动画期间:19.27

**基准上埃沃:**
FPS:24/24
FPS动画期间:13/24

MS:36
MS动画期间:80

内存:2.931
MEMORY动画过程中:2.993
 

解决方案

不要使用矢量:这是可怕的。你需要做的是使用方法的cacheAsBitmapMatrix,但仅当您使用的是Android版AIR发布设置发布。

<一个href="http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/display/DisplayObject.html#cacheAsBitmap" rel="nofollow">http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/display/DisplayObject.html#cacheAsBitmap

另外关于采取GPU加速的优势,移动/ Android的引导您完成的基准和实现的视频教程:

http://gotoandlearn.com/play.php?id=132

和作为最后更新的答案,这里是一个伟大的文章,比较在Android平台+基准绘制所有这些方法:

http://labs.byhook.com/2011/01/13/digital-sheep-air-for-android-drawing-performance/

它详细讨论了不同的实现,以及为什么有些人比别人更好/更差。

I am developing a game for the Android platform using flash cs5 and AS3.

problem: the game will run at 24-29 fps until I call a movieClip that has frame by frame animation, then it will drop to 10-14 FPS. It looks perfect on my PC and does not lose frames until I move it to my Evo for testing. I have tested on an Epic also and I do not lose Frames which leads me to believe that it is the pixil population in the evo that is causing the problem but I have tried everything I can think of to not make it so intense on the graphics but same results every time.

It's a 20 frame animation and my FPS in flash is set to 24

What I have tried:

png's on each frame | gif's on each frame | pen tool vector drawing of each image on each frame | tween instead of frame by frame | static image in the movie clip and creating a loop in AS3 that will cycle through the images | onEnterFrame |

The only thing that actually does make it smooth is having the same image on each frame. This is why I believe it is the graphics and not the processor.

**Benchmark on PC :** 
FPS: 24/24
FPS DURING ANIMATION: 24/24

MS: 33
MS DURING ANIMATION: 33

MEMORY: 18.87
MEMORY DURING ANIMATION: 19.27

**Benchmark on Evo :** 
FPS: 24/24
FPS DURING ANIMATION: 13/24

MS: 36
MS DURING ANIMATION: 80

MEMORY: 2.931
MEMORY DURING ANIMATION: 2.993

解决方案

Do not use vector: it's terrible. What you need to do is use the cacheAsBitmapMatrix method, but this is available only if you're publishing using the AIR for android publish settings.

http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/display/DisplayObject.html#cacheAsBitmap

Also a video tutorial about taking advantage of GPU acceleration on mobile/android that walks you through benchmarks and implementation:

http://gotoandlearn.com/play.php?id=132

And as a last update to the answer, here is a great article comparing all these methods of drawing on the android platform + benchmarks:

http://labs.byhook.com/2011/01/13/digital-sheep-air-for-android-drawing-performance/

It discusses at length the different implementations and why some are better/worse than others.

这篇关于FPS放缓显著逐帧动画使用帧时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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