I am really impressed by all molehill demos which already build. Molehill is the codename for GPU-accelerated rendering for flash. However I was kinda depressed when visiting the presentation Making A Molehill Out Of A Mountain on FITC Amsterdam. Accessing the GPU is really low-level. That is great news because it opens lots of possibilities, but it is depressing because it is low-level. Even if you are trying to be an pro/expert, you must be a freaking uber-talented geek to understand and be able to write shaders, assemblers, assembly (??) code which is needed for the real Molehill stuff. Respect for that. I am a geek, but that is way too difficult for me. I have tried to look to the content of AGALMiniAssembler from adobe, but I think thats not written by real humans. 😉
My point is; we have to wait for great frameworks. There are already 3D engines which are molehill-enabled (Alternativa3D, Away3D and some others). The GPU gives render powers. A brilliant idea of Tom Kcha is M2D. He came up with a 2D rendering system which uses the GPU inside a framework. I think this is a little jewel and is experiment-worthy, because I am using 2d content most of the time. The example codes are understandable. No freaking shaders, but normal AS3-like code. I think there will be more frameworks which will use the power of GPU rendering soon.
Experimenting with M2D – Molehill 2d
If you want to see my test with M2D, take a look at my two different versions of 2000 smilies. I have noticed they both use a lot of CPU but the M2D version renders about 3x smoother. I think this whole idea of 2d content on GPU is awesome! 😀 Adobe should implement this in a way to the ‘normal flashplayer’. Yes, there are limitations in the current workflow. You are mostly limited to bitmaps only, so you’ll need to know something about real sprites and blitting. However if you are using the example files, it will convert lots of different types of object (movieclips, shapes, animated-gif-like-sprites) to bitmap-objects for you. Imaging if games will implement this, they will have more rendering powers for free; that is huge and promising.
On twitter I said M2D did not support alpha, but in the latest version there is an alpha property too. I still wonder how much M2D could be optimized to get most out of 2d GPU rendering.
Getting started with Molehill
Now, you want to use Molehill to, right? 😀 Let’s do it! Setting up a molehill-enabled environment is relative easy if you are using FlashDevelop:
1. Download the activeX incubator FlashPlayer for windows. IE uses activeX, and FlashDevelop tabs use IE. 🙂
2. Download latest version of flashdevelop
3. Download nightly build of the Flex SDK (You’ll need 18.104.22.16886)
4. Download this flashplayer_inc_playerglobal_022711.swc. This includes classes for Molehill. Rename it to playerglobal.swc and place it at (flex_sdk location)\frameworks\libs\player\10.1
5. Create a new AS3 project in FlashDevelop, and target FlashPlayer version 10.1 in the project properties. Keep the properties open and choose to publish in a tab. Then navigate to tab Compiler options, and add
-swf-version=13 to the Additional Compiler Options. In the custom path to Flex SDK (same tab) you’ll need to point to the Flex SDK folder you have just downloaded.
This should be enough to start building molehill projects.. and also to use M2D:
Getting started with M2D
The future is bright. Can’t wait to see more great+fast performing examples using this technology. Now.. start making cool shit already!