Archive for category AS3

Vertex Shader Inputs Demystified

Tags: , , , ,

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.

Read the rest of this article »

5 Comments

How To Minimize AMF Serialization Size

Tags: , , ,

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.

Read the rest of this article »

4 Comments

Introducing Timely: A Sub-Millisecond Timer

Tags:

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.

Read the rest of this article »

4 Comments

Get Control Over [Embed]

Tags: , ,

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.

Read the rest of this article »

9 Comments

Custom JSON Parsing with Reviver Functions

Tags:

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.

Read the rest of this article »

1 Comment

Domain Memory Opcode Performance: Reading and Writing

Tags: , , , ,

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.

Read the rest of this article »

9 Comments

An ASC 2.0 Domain Memory Opcodes Primer

Tags: , , , ,

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?

Read the rest of this article »

28 Comments

Stage3D vs. WebGL vs. AIR

Tags: , , , ,

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.

Read the rest of this article »

20 Comments

Flash vs. HTML5: Text Rendering Speed

Tags: , , ,

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!

Read the rest of this article »

11 Comments

Flash vs. HTML5: Stage3D vs. WebGL

Tags: , , , ,

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.

Read the rest of this article »

16 Comments