flash.sampler.getSize()
is a handy tool for figuring out how much memory a class instance uses. However, it is often flat-out wrong. Today’s article tries it out on a variety of classes to find out which ones it works on and which ones it doesn’t.
Posts Tagged stage3d
In almost all circumstances, Stage3D
requires you to provide textures with power-of-two dimensions. This is often inconvenient as most images are not already sized that way. Today’s article provides a simple class to easily build a texture with power-of-two dimensions. An example app is also provided.
When you request a Context3D
you’ll either get the requested profile or software rendering. But what if you’d rather fall back to a lesser hardware context? What if your app can make use of the regular/baseline profile but can run with reduced graphical effects using the constrained mode profile? Today’s article presents a utility class that makes it a snap to always get the best Context3D
that Flash Player can give you.
Flash makes it pretty easy to use any DisplayObject
as a Stage3D
texture. This is a great feature since you can use powerful, traditional classes like MovieClip
, Sprite
, TextField
, and Shape
to build a texture—often with vector graphics—and then use Stage3D
‘s GPU hardware acceleration to render them with maximum performance. But this path is fraught with subtle problems, any one of which could result in poor rendering quality that’s quite hard to debug. Today’s article takes you through the process step by step to make sure you end up with great results.
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.
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.
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.
Flash (mostly) won the first bitmap test against HTML5 but was then defeated once rotation and scaling entered the mix. Can Flash make a comeback by leveraging hardware acceleration via Stage3D
? Today’s test finds out!
ATF textures are great at reducing texture memory usage but sometimes you can’t use them. If you’re dynamically generating the texture (e.g. from a snapshot of a DisplayObject
) or you’re loading the texture from a third party then you won’t have the (realistic) option of using compressed ATF textures. Today’s article shows how you can still save a bunch of memory, even without ATF.
One essential to a Stage3D
app is the ability to manipulate models in the 3D scene. Today’s article presents a class for making this really easy by avoiding all the manual work you’d to to save translation, rotation, and scale values as fields and manipulate various Matrix3D
instances. Read on for the source code and a demo app.