Posts Tagged texture

Using Alpha Textures With Stage3D

Tags: , , , ,

Stage3D makes a lot of common tasks more complicated. One such task is using a texture/image that has alpha on it. With classic 2D Flash, this is done automatically for us. With Stage3D, we must resort to some obscure tricks. Today I’ll show you those tricks so you can use alpha textures in your Stage3D-accelerated Flash app.

Read the rest of this article »

2 Comments

Double the Performance of Stage3D Apps

Tags: , , , , , ,

To draw with Flash Player 11’s Stage3D API, you must set up the state of various GPU resources before finally calling drawTriangles. Inevitably, you’ll end up calling drawTriangles multiple times during a single frame to draw your characters, terrain, sky, and so forth. In between these calls you will change the GPU’s state by calling Context3D‘s set* functions. This article will show you which of these functions can literally cut your app’s performance in half.

Read the rest of this article »

15 Comments

Stage3D Draw Calls: Part 3

Tags: , , , , ,

So far we’ve seen how to use Stage3D to get massively increase performance with hardware acceleration, but that performance has come at a cost: we must use the same texture for each object we’re drawing. Today we’ll smash that requirement without losing an ounce of performance!

Read the rest of this article »

13 Comments

Stage3D Draw Calls: Part 2

Tags: , , , , ,

Today’s article shows you how to get great performance with a ton of sprites by reducing your Stage3D draw calls. As we saw last time, Stage3D performance is not guaranteed to be good and falls significantly below normal 2D Stage performance even on expensive tasks like scaling and rotating Bitmap objects as well as redraw regions covering the whole stage. Today we’ll show how to overcome those performance problems and beat the tar out of the 2D Stage.

Read the rest of this article »

5 Comments

Simple 2D With Stage3D

Tags: , , , , , , , ,

Along with Flash Player 11’s new Stage3D class have come hardware-accelerated 2D rendering engines. Impressive results have already been demonstrated by advanced engines like Starling and ND2D. Today’s article shows a simple Stage3D-based sprite class to help learn more about how these engines are implemented and provides a simplified alternative to the more complex 2D engines that still delivers hardware-accelerated performance.

Read the rest of this article »

10 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