Archive for category AS3

Simple Stage3D Camera

Tags: ,

There are many fine 3D frameworks for the new hardware-accelerated Stage3D class in Flash 11 that are loaded with features. But, if you just want to get some simple 3D up and running or would just prefer to do things yourself, today’s article shows you a simple 3D camera that you can use to view your 3D scenes and models. Read on for the source code and a demo app.

Read the rest of this article »

11 Comments

AS3 vs. AS3

Tags: ,

One frequent request I get on my AS3 vs. JavaScript series is to test AS3 in more environments. Today I’m doing just that and testing its performance in browsers (plugin and ActiveX control) and standalone/projector mode across Mac OS and Windows operating systems. Does it make any difference? Read on to find out!

Read the rest of this article »

8 Comments

Serialize Anything

Tags: , ,

The ByteArray class, introduced in Flash Player 9, has a pair of very powerful functions alongside all the usual ones like writeInt. It actually allows you to read and write AS3 objects and provides an easy, fast, and compact way to serialize anything without writing any code. Today’s article explores shows you how to harness the power of these functions to improve your data serialization and deserialization.

Read the rest of this article »

39 Comments

AS3 vs. JavaScript Performance Followup (November 2011)

Tags: ,

It’s been about 8 months since my last test of AS3 versus JavaScript and there have been several major releases of both browsers and the Flash Player. Today, we pit every major browser against each other and Flash Player itself to get an updated picture of which provides the fastest scripting environment on the web.

Read the rest of this article »

11 Comments

Stage3D AGAL Instruction Speed

Tags: , , , , , , ,

Flash Player 11’s new Stage3D hardware-accelerated graphics API not only allows you to write shaders (custom code to position vertices and color pixels), it downright requires you to do so. To get the lowest level access (and therefore most power) out of your shaders, you write them in an assembly language called AGAL. Read on for a test app that compares the speed of these shader instructions, the fundamental building blocks of all Stage3D apps.

Read the rest of this article »

12 Comments

Stage3D Upload Speed Tester

Tags: , , , , ,

Since Flash Player 11’s new Stage3D allows us to utilize hardware-acceleration for 3D graphics, that entails a whole new set of performance we need to consider. Today’s article discusses the performance of uploading data from system memory (RAM) to video memory (VRAM), such as when you upload textures, vertex buffers, and index buffers. Is it faster to upload to one type rather than another? Is it faster to upload from a Vector, a ByteArray, or a BitmapData? Is there a significant speedup when using software rendering so that VRAM is the same as RAM? Find out the answers to all of these questions below.

Read the rest of this article »

28 Comments

Stage3D VRAM Tester

Tags: , , , ,

Flash 11’s new Stage3D enables us to make amazing 3D games and applications in Flash. It also burdens us with two forms of memory: the system memory (RAM) we’re used to and the video card’s memory (VRAM) that stores objects like textures, buffers, and shaders. In order to not use more VRAM than the player’s video card has, we must know how much VRAM they have. Unfortunately, the Stage3D API does not provide us with this information. Today’s article provides a workaround function that allows you to quickly test your players’ VRAM. UPDATED to fix some bugs in the test

Read the rest of this article »

17 Comments

Simple Stage3D Benchmark

Tags: , , ,

Flash 11’s new Stage3D API gives us hardware-accelerated 3D graphics, which is a major jump forward for Flash-based games and simulations. Along with this comes some added responsibility: we must now care about our users’ graphics cards. Today’s article features a simple benchmarking application that you can run to get a basic idea of how Stage3D is performing on a certain computer. Read on for the benchmarking app!

Read the rest of this article »

8 Comments

Stage3D Readback Performance

Tags: , , , , , ,

At long last, Flash Player 11 has been released and carries with it a raft of exciting new features. Perhaps most exciting is the inclusion of the new Stage3D class (and related libraries) to enable GPU-accelerated graphics rendering. Today’s article will be the first to cover this new API and discusses one of its features: reading back the rendered scene into a BitmapData that you can put on the regular Stage. Surely this will be a popular operation for merging 3D and 2D, so let’s see how fast it is!

Read the rest of this article »

13 Comments

Checking Class Inheritance

Tags: , , , , ,

I recently received a tip about a thread discussing an interesting problem: how to tell if one Class object represents a class that subclasses another Class object. If you had an instance of the class, you could simply use the is or instanceof keywords, but that won’t do here. Today’s article shows how to solve this tricky problem.

Read the rest of this article »

20 Comments