How to: draw a cube with Minko

Today I want to talk about Minko’s API. Whats it looks like and how it feels to work with it. This is the first time ever I show some actual code using Minko. There is a great buzz around Molehill and the next release of the Flash Player in general. Please note that evet if – for obvious reasons – this post does not use the Molehill-powered version of Minko, the APIs look “pretty much” the same.

The goal of the post is for people to see what it looks like. Feedbacks are very much welcome and would be greatly appreciated!

Before we start, here is the (very) simple application we will build:

Tutorial right after the jump…

aerys-monitor library updated

The aerys-monitor is a small and lightweight library inspired of Mr.Doobs “stats” library. Here are the main features :

  • watch any property of any object of any class
  • customizable update rate
  • cutomizable per-property color
  • chart rendering for numeric values
  • watch framerate, memory and Flash Player version
  • ready to use framerate property

The Monitor class has been updated with the following changes :

  • Flash player version style is now called “version”
  • new property “backgroundColor” to change the background color of the monitor
  • new “framerate” to get the framerate of your application
  • the framerate and memory usage are now monitored by default

Here is a sample snippet to show how simple it is to use :

And here is how it looks :

The library is under GNU v3 licence and is available on Google Code. Have fun !

Pixel shader demo using Flash 10, Pixel Bender and Minko

I’m really excited to announce Minko (which is, by the way, the final name for my 3D library) has reached a new level: pixel shader integration! Pixel shaders are little programs that run on each pixel and can modify their final color. They are often written in C-like languages and in this precise case we use Pixel Bender, the shader language introduced with Flash 10.

In this post I will:

  • Explain how any 3D scene is built when using Minko
  • Explain how pixel shaders are integrated in the 3D scene
  • Explain how pixel shaders are built using Pixel Bender
  • Show you a very simple demo of the kind of effects pixel shaders will provide
  • Explain how the demo was built

Here are a two screenshots to show the results:

Phong shading + spheric environment mapping on a 2700+ polygons Lamborghini
Phong shading + spheric environment mapping demo

Technical details and a live demo right after the jump!

Speaking at the french Flash user group

… or at least that’s the plan! The next meeting of the Tonton Flexers – the closest thing to a “french Flash user group” – is taking place the 23rd of this March and I’ll be there to present my 3D library.

I would be more than happy to talk about the software, the way I built it and the technical choices that drove its development. I will  also try to emphasize what makes this library different through a few demonstrations.

Depending on the agenda of one of my co-worker, we might also present a very cool piece of software I never spoke about!

You can read more about the event here (in french).

Voice Recognition in Flash 10

The following video demonstrates a new “voice gesture” library targeting the Flash Platform. As you might have guessed, those “voice gestures” are pretty much like “mouse gestures” but they are activated by voice only. I guess it uses some kind of voice learning/recognition algorithm. I can’t stress enough how trhilled I am to see this kind of new and powerful software coming to Flash. This enables a whole new kind of usages and applications…


Voice Gesture from didier.brun on Vimeo.

Frustum Culling in Flash 10

Update: corrected a few glitches in the bounding sphere creation routine.

Optimization is always important. But when it comes to 3D for the Flash Platform, it’s an everyday battle. The first ideas that come to mind are to avoid:

  1. redrawing the same regions : each pixel value must be set once and only once
  2. rendering invisible objects : objects that are out of sight still take a lot of CPU horsepower

While Flash takes care of the first one in its very renderer, the second one is not handled. But that is something we can easily address!

The Technic

The method is called “frustum culling”. The big picture is that every mesh is approximated using a bounding volume (typically a sphere or a box). If the bounding volume is visible, the corresponding mesh is rendered. The two following pictures show the frustum culling caught in action:

The mesh is visible
The mesh is visible: TPS counter indicates 18900 triangles per seconds
Frustum culling in action (TPS counter indicates 0!)
The mesh is out of sight: frustum culling is acting and TPS counter indicates 0!

Code snippets and a live experiment right after the jump!