Stage3D
is hugely powerful, but with that power comes a very new and very complicated requirement for many programmers: shaders. Shaders are tiny programs that run on the GPU and are hugely limited compared to fancy CPU-side languages like AS3. For many programmers new to shaders these things are truly mind-bending. They’re even split into two parts: vertex and fragment shaders. Today’s article focuses on the two kinds of inputs to vertex shaders and seeks to explain them and clear up some of the confusion.
Archive for category AS3
I’ve talked about AMF serialization size before, but there’s one tip I left out. Today’s article shows you one crucial step you need to take to make sure your AMF data is packed as tightly as possible so you’re not wasting file size or bandwidth.
Whether you’re using Adobe Scout or good old getTimer
, there is a fundamental limitation: all times are in whole milliseconds. This is an issue if you’re trying to measure code that executes very quickly or compare code that has only minor differences. In these cases you get inconsistent results (7ms, 8ms, 7ms, 7ms, 8ms, …) when you’d much rather have better accuracy (7.3ms) with sub-millisecond precision. Today’s article introduces a new helper class called Timely
that makes sub-millisecond precision a snap. Read on for the source code and an example app.
The [Embed]
metadata tag has been in AS3 since the beginning, but few know how to use it fully. Today’s article shows how you can go beyond the standard usage to maximize the usefulness of [Embed]
. Read on for some useful tricks you may not know about and take another step toward mastering AS3.
The built-in JSON
class that debuted with Flash Player 11 has an interesting feature that few AS3 programmers know about. It turns out that JSON.parse
doesn’t just take the JSON document to parse but also a “reviver” Function
. What is this? How can it be used? Find out more in today’s article and take advantage of this powerful parsing option.
In last week’s primer on the new domain memory (“Alchemy”) opcodes the initial test showed that they couldn’t match the performance of good old Vector
when writing out a lot of float/Number
values. Today’s article expands on that test to check the performance of writing integers and the performance of reading integers and float/Number
values. Can the domain memory opcodes redeem themselves? Read on to find out.
Since January, Adobe has dropped the “premium features” requirement for Flash apps that use the “domain memory opcodes” (a.k.a. “Alchemy opcodes”) that provide low-level performance-boosting operations that let you deal more-or-less directly with blocks of memory. Then in February we got Flash Player 11.6 along with built-in ASC 2.0 support for this feature. Today’s article shows you how to use these opcodes and takes a first stab at improving performance with them. Are they really all they’re cracked up to be?
Today’s article is in response to the many requests to include Adobe AIR in the “Flash vs. HTML5” series of articles. While it’s not a browser-based competitor, it certainly is a competing platform on iOS and Android. So I’ve taken the “Stage3D vs. WebGL” test and packaged it as an AIR app. How does AIR compare? Read on to find out.
The “Flash vs. HTML5” series has covered bitmap drawing pretty well by now, but what about text rendering? Virtually every game has text in it and sometimes a lot. Quest text, name tags, button labels, tooltips, and so on combine to fill the screen with quite a bit of the stuff. So how does Flash’s text rendering compare with that of HTML5? Read on to find out!
WebGL is not ready for prime time. It’s just not available on enough of the browsers people actually use for any mass-market game to seriously target it. But what if everybody used browsers that supported WebGL right now? Would it be competitive then? Today’s article explores that question to find out just what kind of game you could make today to take advantage of HTML5 and WebGL and compares it to the performance you’d see had you gone with Flash’s Stage3D
hardware acceleration.