Jean-Marc Le Roux Web, RIAs and chocolate spaghettis…

16Apr/129

Render To Texture With Minko 2

Update: If you want to give it a try, you can start working with Minko 2 beta today!

During last week "Starting With Shaders" workshop, nicoptere asked me about Render To Texture (RTT). RTT is a very common technique used for multi-pass rendering. The principle is quite simple: the pre-passes render the scene in one or more textures. This texture can then be sampled to provide per-pixel data during the rendering pass.

A very common use for RTT is shadow mapping. Shadow mapping is a technique to create projected shadows. The shadow mapping rendering pass will require access to the depth of each pixel as seen from the light source which is "emitting" the shadow. Therefore, each mesh will have more than just a rendering pass. Indeed, we will have to add a pre-pass for each light in the scene to generate it's "depth map".

RTT can also be used to create portals! So it's a very cool feature.

Demo/Code snippet after the jump...

13Feb/121

Procedural Animated Flag With Minko ShaderLab

I used Alexandre's work about waves simulation on the GPU with the ShaderLab to create a French flag with a simple blue-white-red procedural texture. Here is the result:

As always with the ShaderLab, not a single line of ActionScript and everything is hardware accelerated! If you want to subscribe to the Minko ShaderLab beta, you can apply on the "Minko ShaderLab: Beta testers wanted!" thread on Aerys Answers.

30Sep/113

NAO AS3 API released as open-source

Long time no see! As you can imagine I'm quite busy with Minko and Flash 11 stuff right now. Still, I would like to introduce some related work. Do you know Nao?

Nao is a quite impressive humanoïd robot. It has a lot of features, from text-to-speech to face recognition. And of course, it can walk and look around... seeing it in action is actually completely amazing! As I introduced Aerys' work to Aldebaran, they asked me to work on an ActionScript 3.0 wrapper for Nao's remote APIs as a part of a bigger project I will speak about soon.
Technical details and code samples after the jump...

29Dec/107

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...

2Dec/100

Back from Adobe “Retour de MAX” 2010

I was at "Retour de MAX" ("Back from MAX") 2010 - an Adobe France event - to present Molehill, the new 3D API for the Flash Platform, alongside Adobe's web consultant David Deraedt. The goal was to present the technical details about Molehill and the pros and cons of the API. We also wanted to demonstrate how Minko, our 3D engine, adds all the features Flash developers might expect when dealing with 3D.

We also presented a worldwide premiere demonstration of the new Flash 3D capabilities right in the browser (Internet Explorer 8 in this case). This experiment follows my work on rendering Quake 2 environments with Flash 10 using Minko. Of course, the new Molehill 3D API and the next version of Minko built on top of it makes this kind of work a lot easier. For this demonstration, we chose to present a Quake 3 environment viewer using HD textures provided by the ioquake3 project. Here are some screenshots (more screenshots on the Aerys website):


Video and more details right after the jump...

10Nov/100

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 :

// get a singleton Monitor object
var monitor : Monitor = Monitor.monitor;
 
// set the update (refresh) rate to 15 updates per second
monitor.updateRate = 15.;
 
// add the monitor to the display list
stage.addChild(monitor);
 
// watch the rotationX property of the camera object with a scale value of 1 / (PI / 2)
monitor.watch(camera, "rotationX", 0x55ff00, 1. / (Math.PI / 2.), true);
// watch the rotationY property of the camera object with a scale value of 1 / (2 * PI)
monitor.watch(camera, "rotationY", 0xff5500, 1. / (2. * Math.PI), true);
// watch the rotationZ property of the camera object with no scale value (=> no chart rendering)
monitor.watch(camera, "rotationZ", 0x5599ff);
 
// watch multiple properties
monitor.watchProperties(physics,
			["processingTime", "speed"],
			[0x00ff00, 0xff0000],
			[1. / 40., 1. / 10.]);
 
// change the background color (0xAARRGGBB)
monitor.backgroundColor = 0x7f000000;

And here is how it looks :

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

9Apr/1016

Apple makes its own compiler… illegal!


"3.3.1 … Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited)."

This is the very bad (sad) addition (restriction) to the iPhone developers program everyone is talking about right now. And I feel very concerned about this... and now everyone is wondering if software like the Flash-to-iPhone packager, Mono or Unity are definitely banned from the iPhone programming tool-chain.

I never talked about it before, but Aerys is working on a project targeting the iPhone and the iPad (among a lot of other platforms). And this very project is leveraged by some home-made code generation tool. Therefore, we are very scared of what this kind of restrictions might imply for our business.

But as scary as this statement might look at first, it is actually even funnier when you understand it makes any iPhone/iPad application illegal. And it gets even better because even Apple's standard tool-chain finds itself... prohibited!

The reason is very simple: Objective-C, C or C++ never "link" to any library providing the Documented iPhone APIs. Objective-C, C or C++ actually never link to anything. When compiling your code, the compiler creates an intermediary representation of your program in order to make it easier to (eventually cross-)compile it. In the case of GCC, the compiler used to build such applications, those intermediary languages are:

(Source: Wikipedia - Intermediate language)

This very intermediate representation is built before the symbols resolution and before any linking is done. Thus, linking against the "Documented APIs" has always been done "through an intermediary translation or compatibility layer". And it won't change anytime soon! But, still, I wish good luck to Apple's engineers in their future work to patch GCC and make it "compliant" (sic!).

To me, it is the most obvious sign that Apple doesn't care about its developers (but I was still pretty thrilled to eventually become one of them about a few days ago...). Not because it bannishes any interesting cross-compiling software venture. And not even because any iPhone/iPad developper who knows about other platforms openness and ease of production will feel sick just by reading this kind of restrictions.

No. To me, Apple is losing it all simply because this kind of idiocy can only be written by someone who doesn't have a clue about how a computer/compiler works! Apple started building casual devices and ends up targeting casual developers. Could this be the first sign of how (so called) intuitiveness - when enforced by completely hermeticly closed devices - finally makes people... dumber? So now the real question is "What happens when your developers program EULA is written by a marketing control-freak moron?".

PS : The title of this article was desgined to attract the eye. It is my interpretation of the latest Apple's developers program EULA additions and I might be completely off or wrong. Anyway, the doubt and worry caused by this very fuzzy and unclear addition stands as a major issue for all the companies and developers targeting the iPhone and iPad platforms.

1Apr/100

AS3 Monitor released on Google Code

I just released a small but useful piece of software on Google Code: my ActionScript 3.0 Monitor class. This little class makes it possible to watch the properties of any object directly on the stage.

It was inspired by Mr. Doob's Stats class. But my Monitor class is entirely dynamic and you can watch any property of any object.

The following simple (and useless?) code sample show how to track the (x, y) position of the mouse cursor on the stage:

package
{
  import aerys.monitor.Monitor;
 
  import flash.display.Sprite;
 
  public class MonitorDemo extends Sprite
  {
    public function MonitorDemo()
    {
      var monitor : Monitor	= new Monitor(30);
 
      monitor.watch(stage, "mouseX", 0xff0000, 1. / stage.stageWidth);
      monitor.watch(stage, "mouseY", 0x008800, 1. / stage.stageHeight);
      addChild(monitor);
    }
  }
}

And here is the result:

Here is another simple use case: tracking the (x, y, z) rotation of a 3D camera (the actual application is available on the official Aerys website):

The code is open source and available on Google Code. Comments and suggestions would be greatly appreciated!

17Mar/102

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).

17Dec/090

AIR 2.0 HTTP Web Server

AIR 2.0 brings a lot of new features. Among them is the new ServerSocket class. The Socket class exists since Flash 9 and enabled a lot of new client/server applications. But it has always been limited to client side sockets as long as AIR (and the Flash Platform as a whole for that matter) is concerned. Therefor, this new server socket feature makes it possible to build actual server software using AIR!

Rich of this new and incredible ability, Christophe Coenraets posted a small but yet very powerful code snippet to build an HTTP web server using AIR 2.0!