Starling 2.0 Final 翻译

Starling 2.0 Final

Daniel Sperl on April 19, 2016

It‘s been several weeks already since I offered you a first look at the brand new version of Starling (if you haven‘t read my previous post yet, make sure to do so before continuing: Starling 2.0 Beta). Many developers were brave enough to take it for a test ride or even port their existing games over to the new version. That feedback was extremely valuable for me — thanks a lot to everyone who participated!

从上次发布最新的Starling版本到现在已经有几周时间了。很多勇敢的开发人员已经在测试甚至直接将他们的游戏基于新版本就行构建。那些反馈对我来说真的很有价值,感谢那些身先士卒的勇士们。

So you kept me quite busy, but it was well worth the effort: not only was I able to move lots of potential issues out of the way, but I could also spend some more time on polishing the new version.

由于这些反馈,我就一直很忙,但是这些努力都非常的又价值:这不仅仅是因为我可以处理掉一些潜在的问题,也可以让给我花更多的时间去打磨新版本。

Thus, finally, it‘s time to make the next step and publish the official version! Read on to find out all about the additional changes that made it into the "Starling 2.0" release.

这样,最后,是时候去做开始下一步了,发布官方版本!继续阅读,去发现Starling的一些变化,这些变化使它变成了Starling 2.0 release .

Bringing CPU usage down to ZERO

使CPU下降到0

Sometimes, it‘s the simple things that have the biggest impact. Remember the new "render cache" I introduced in the new version, which optimizes CPU workload for static parts of the display tree? It turned out I could even take this one step further. (A huge thanks to maximgavrilov for coming up with this idea!)

很多时候,重新构建会使原有程序和Starling有较大的不兼容性,但也只有这样才能保持它的单纯,以及后续的持续成长。(理解了一下更改是这个意思)。是否记得我之前提到过的渲染缓存,它可以降低CPU负载,当有很多静态对象的情况下。我又对这个重新做了进一步的调整。

It happens surprisingly often in an app or game that a scene stays completely static for several frames. Just look at the Starling Demo or the Feathers Component Explorer: as long as you‘re not directly interacting with the app, they are mostly static. So why redraw the stage at all?

这种情况在APP或游戏中非常常见,场景会完全静止很多帧。可以看一下Starling Demo和Feathers Component Explorer,只要你不直接和APP交互,那么他们其实都是静止的,那为什么不直接渲染整个Stage呢?

That‘s exactly the point of the new skipUnchangedFrames-property. If enabled, static scenes are recognized as such and the back buffer is simply left as it is. On a mobile device, the impact of this feature can‘t be overestimated! There‘s simply no better way to enhance battery life.

那就是新的  skipUnchangedFrames 属性。如果启用这个属性,静态场景会被这样识别,直接简单的使用一个后台缓存就搞定。在一个移动设备中,也不是所有的情况都符合这种场景,所以还是要保留你的期望值。这是一个简单的方法提升电池寿命。

You might ask why I didn‘t activate this feature by default. The reason: RenderTexture and cclasses need special treatment when it‘s enabled (requiring a call to setRequiresRedraw whenever their content changes), so I decided to better not cause any unpleasant surprises. Still, it‘s highly recommended to always activate this feature; especially since it doesn‘t cost anything, performance-wise.

你可能会问为什么不默认就打开这个特性。那是因为RenderTexture和RenderTexture类需要特殊的处理。所以我决定最好不要有一个不愉快的惊喜。但是任然建议激活这个特性。因为他没有任何消耗,性能提升上是一个比明智的选择。

One more thing: to make it easy to recognize if you are utilizing this optimization in a given moment, I modified the statistics display slightly: it will now turn dark green whenever a significant amount of frames is being skipped. Keep an eye on that!

另外,为了能够简单地识别处是否正在使用这个优化方法,我稍微修改了一下statistics display,当那些帧被跳过时它会变成墨绿色。

 

Optimizing Filters

滤镜优化

As described in my previous blog post, the filter API of Starling 2 is a massive improvement over the previous version. It‘s easier to write custom filters, you can use them more flexibly, and they make automatic use of the render cache.

正如我之前博文中提到的,滤镜API和之前的版本比有了较大的改进。它将更容易地编写自定义滤镜,你可以更灵活的使用他们,它们直接被渲染缓存支持。

However, in cases where the render cache did not kick in, they were also a little bit slower than before. Well, not any longer! I spent a lot of additional effort on that API and brought it up to speed. The final render pass now draws directly into the back buffer, without detour over a texture.

尽管如此,在某些渲染缓存没有涉及的地方,滤镜的效率还是会比之前的版本略慢一些。但是这段时间并不长,我另外花了时间在这些API上,使他们有更快的速度。最终的渲染器直接写入Back Buffer,不需要在文理的基础上绕弯了。

You need even more speed? Performance junkies now have all the options they need: cache the filter output, use a lower resolution, or even change the textureFormat to a lower bit depth — all without compromising any of the original API enhancements.

你想要更好的性能不?性能控们会有更加全面的选择了,缓存滤镜输出,使用较低的分辨率,或者使文理类型使用较低的位深,而这些不会影响到原始API的性能提升。

All modesty aside, you won‘t find a filter API anywhere else that‘s as easy to use, as fast, or as flexible as this! ??

不谦虚的说,你不可能在别的地方找到一个比这个更好用,更灵活、更快的滤镜API了

Optimizing the Rest

其他优化

A huge part of my time was also spent on performance optimizations throughout the complete rendering pipeline. I found a number of shortcuts to exploit as well as bottlenecks to avoid, bringing up performance to a fantastic level.

我的大部分时间都花在通过渲染通道的优化来提升性能。我找到一些捷径去避免那些性能瓶颈,把性能提升到一个更高的层次。

All in all, my tests indicate that the CPU consumption of Starling 2 is typically a little higher than 1.8, which is simply a side effect of the additional flexibility (it seems the old saying about the "free lunch" has some truth in it, after all). On the other hand, GPU usage was reduced significantly, meaning you can move around more pixels than before and you‘ve got more options to speed things up manually.

总的来说,我的测试指出,CPU消耗,Starling 2要比1.8略高一些。这些主要是用于提高灵活度,(毕竟世界上没有免费的午餐)。另外GPU消耗情况下降的比较多。这就是说,你可以比以前移动更多的像素,也可以手动设置一些额外的选项来提升速度。

As for bug reports, I was actually surprised how few problems popped up, despite the big number of testers! I think that‘s a testament to the robustness of the new architecture; cleaner code makes for less bugs, that‘s the simple truth.

Wrapping it all up

I‘m extremely happy that I can finally scrap that "beta" sign and make Starling 2.0 "final". Personally, it marks the conclusion of a long and exciting development phase that confronted me with way more challenges than I ever anticipated — and I‘m very proud of the result.

Now, what comes out of this is all in your hands! I can‘t wait to see the ways in which you push the new architecture to its limits. (Deferred Shading, anyone? A new filter collection? Or Cross-Texture Batching?)

You can download Starling 2.0 at the usual place, of course! Don‘t forget to drop a comment below to tell me how it works for you. I‘m looking forward to your feedback!

But wait, before you go, there‘s one more thing. It‘s ...

Give-Away-Time!

一下是MyFlashLabs提供免费的ANE,大家可以去看看

To celebrate the release of Starling 2, the guys from MyFlashLabs approached me with a special offer exclusively for Starling developers: they are giving away some of their most popular native extensions for free!

All you have to do is put those ANEs into the shopping cart and use the coupon-code "free-ane-for-starling-users" at checkout.

Pro developers who need more ANEs and want guaranteed support can save even more money: MyFlashLabs agreed on a 60% discount on their club membership (coupon: "club-for-starling-users"). As with the individual ANEs, this offer may be used only by Starling developers.

Knowing that many Starling developers are struggling to find great ANEs, I simply couldn‘t say "no" to this offer. ?? My thanks to the complete MyFlashLabs-team!

时间: 2024-10-10 09:37:54

Starling 2.0 Final 翻译的相关文章

Starling 2.0 Beta Note 翻译

Starling 2.0 Beta Daniel Sperl on February 29, 2016 Seven months ago, I set myself the goal of bringing Starling to the next level. To completely rethink its rendering architecture; to make it more extendable; to clean up all the tiny little compromi

jboss规则引擎KIE Drools 6.3.0 Final 教程(1)

前言 目前世面上中文的KIE DROOLS Workbench(JBOSS BRMS)的教程几乎没有,有的也只有灵灵碎碎的使用机器来翻译的(翻的不知所云)或者是基于老版本的JBOSS Guvnor即5.x的一些教程,而且这些教程都是"缺胳膊少腿"的,初学者看后不知道它到底在干吗?能干吗?能够解决自己系统中什么问题. 所以笔者自己写了几个例子,把整个最新的英文版的KIE DROOLS 6.3.0.Final的官方教程给串了起来,用于供读者使用并以此来作为入门以及相关SOA理念的推广的第一

cocos2d-x 3.0 final 移植 android

准备工作 你仅仅要依照上一篇的 cocos2d-x 3.0 final 环境搭建 完毕就能够了 1.编辑proj.android\jni\Android.mk,更改内容例如以下 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := cocos2dcpp_shared LOCAL_MODULE_FILENAME := libcocos2dcpp # 遍历文件夹及子文件夹的函数 define walk $(wildcar

Keycloak 2.2.0.Final 发布,SSO 集成解决方案

Keycloak 2.2.0.Final 发布了,Keycloak 是一个为浏览器和 RESTful Web 服务提供 SSO 的集成(入门教程qkxue.net).基于 OAuth 2.0 和 JSON Web Token(JWT) 规范.最开始是面向 JBoss 和 Wildfly 通讯,但已经计划为其他诸如 Tomcat.Jetty.Node.js.Rails.Grails 等环境提供解决方案(腾云科技ty300.com). 该版本主要是落定2.2.0.CR1版本中更新的内容: OpenI

JBoss7.1.1 Final+mod_cluster-1.2.0.Final集群配置

项目需求,需要JBoss在windows下集群,记录一下以备后查 JDK:1.7 服务器环境:个人电脑windows xp jboss版本:7.1.1 Final mode_cluster:1.2.0 Final 1.配置mode_cluster 下载mode_cluster 1.2.0 Final windows 32位版本(测试电脑为32位,生产环境依据服务器而定)和Jboss7.1.1 Final 解压mode_cluster 压缩包到目录D:\mySoftware\httpd_mod_c

JavaScript中的两个“0”(翻译)

本文翻译自JavaScript’s two zeros JavaScript has two zeros: −0 and +0. This post explains why that is and where it matters in practice. JavaScript 中有两个“0”: -0 和 +0 .这篇文章解释了为什么,并且指出实际生产中会造成什么影响 1.The signed zero 1.“-0” Numbers always need to be encoded to b

jboss规则引擎KIE Drools 6.3.0 Final 教程(2)

使用JAVA程序调用规则-运行KIE-DROOLS上的规则 第一步:建立一个MAVEN的Java工程 POM.XML 给出pom.xml文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0

VLD 1.0 ReadMe翻译尝试

近期想学习下VLD的实现,打算从最简单的V1.0版本看起.以下是V1.0版本自己尝试翻译下,最新的2.x版本似乎强大了很多. 简介 Visual C++提供了内置的内存检测机制,但其充其量只满足了最小定位需求.VLD工具定位为内置内存泄漏的替代,提供了如下特性: 泄漏内存块的全调用栈回溯,包括文件及其行号: 泄漏内存完整转储(hex和ascii格式): 可定制的泄漏报告等级(报告的详细程度可配置) 相对于Purify和BoundsChecher工具其是免费的,而其他免费工具,往往需要入侵式代码.

JSON-RPC 2.0规范 翻译 中文版

JSON-RPC 2.0规范 起源日期: 2010-03-26(基于2009-05-24的版本) 修正: 2013-01-04 作者: JSON-RPC 工作组 <[email protected]> 1 概述 JSON-RPC是一个无状态的.轻量级的远程过程调用(RPC)协议.本规范主要围绕它的处理方式定义了几个数据结构和规则.这个概念可用于在同一进程中.套接字或HTTP之间.或其他很多消息传递的环境中传输数据.它使用JSON (RFC 4627)作为数据格式. JSON-RPC的设计很简单