Posts Tagged shader

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

System RAM and VRAM Explained

Tags: , , , , , ,

I’ve mentioned the concept of VRAM (video memory) in a few articles, but I still find constant confusion among readers of this site as well as coworkers and colleagues in day-to-day work with Stage3D. Today’s article will hopefully clear up the differences, dispel some myths, and help you make the best use of both of them.

Read the rest of this article »

13 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

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

Introduction to AGAL: Part 3

Tags: , , , , , ,

Continuing from last time, in today’s article we’ll discuss the process of building and using basic shaders. This forms the basis of all Flash 11 Stage3D engines, so you’ll be learning how hardware-accelerated 3D shaders are built from the ground up.

Read the rest of this article »

9 Comments

Introduction to AGAL: Part 2

Tags: , , , ,

To continue the series on Flash 11 Stage3D shader programming, this week we’ll take a look at the data types your shader has available and finally dive into some actual AGAL assembly syntax.

Read the rest of this article »

9 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