闪存:通过“消除缩放”来提高性能;在矢量图形上?
我有一个正在升级的旧版 Flash 游戏(800x600 -> 1024x768)。我可以轻松地登上舞台,但担心表演。将所有内容转换为位图将是一个我想避免的巨大足迹。
我的问题是这样的——如果我不厌其烦地缩放矢量艺术,以便它们有效地进行净零变换,会有什么不同吗?或者说这会有什么不同吗?无论如何,Flash是否都必须将矢量坐标乘以变换,或者它是否针对“无缩放”进行了高度优化?
I have a legacy flash game that is being up-rezed (800x600 -> 1024x768). I can easily scale the stage but am concerned about performance. Converting everything to bitmaps would be a huge footprint I want to avoid.
My question is this-- Would it make any difference if I went to the trouble to scale the vector art so they effectively had a net zero transform? Or would that make any difference. Doesn't flash have to multiply the vector coordinates by a transform anyway or is it highly optimized for "no scaling"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
缩放不会影响内存中矢量图形的大小,仅影响处理时间,因为它们使用已经存在的变换矩阵,即使它为空或没有。你不会发现任何区别。位图必须重新调用并重新渲染。如果你改变它们的比例而不重新打印出来,它不会改变尺寸,但质量会降低,具体取决于你缩放的程度,并且额外的 CPU 功率将被转移。
处理这个问题的最佳方法是调整 Flash IDE 内的资源大小,或者考虑到您有相机之类的东西,我们的简单方法是对最终场景的 bitmap.draw 进行矩阵变换。
希望这有帮助。
Scale does not affect vector graphics size in memory only process time, because they use a transform matrix already in place even if its empty or no. You would see no difference what so ever. Bitmaps would have to be rescalled and rerendered. If you change their scale without re printing them out, it wont change the size but the quality will be diminished depanding on how much you scale and additional cpu power will be diverted.
Best way to deal with this is to resize assets inside of flash's ide OR our easy way out would be a matrix transform on a bitmap.draw of your final scene considering you have somethig like a camera.
Hope this helps.