FLASH PLAYER WARNING
You need to have atleast v10.x.x to view most of my Flash experiments. Please download the latest Flash Player version before continuing.
Actionscript 3 Blog
Flash as background on web pages / stock selling
Doing some experimenting of putting a flash SWF as a background bellow HTML and creating a stock selling package for FlashDen.net.
After some initial trying and failing, I ended up with a minimalistic approach that seems to work on all major browsers. The solution is intuitive; absolutely positioning a DIV element (html based content) over a DIV containing the Flash SWF, and using the z-index css property to handle z-order. Export settings when building the SWF also needs to be correct.
Having discovered FlashDen.Net, I decided to take my Recursive Zoomer and package it in the format FlashDen.Net requires. It literally took hours, as I had to make a preview package, preview image, and the purchase package. I set up a small mini site that will be used for previewing on their site, here it is:![]()
Currently number 96 in their review queue.
UPDATE: After about 5 days in their review queue my package was rejected since they do not accept CS4 (Flash 10) stuff yet.
Recursive Zoomer
Another small experiment from me. Reproducing in Pixel Bender that recursive zoomer effect from the Amiga demo scene ;-)
Use the mouse to change parameters on the interactive versions (mouse at the center for most stability). Configurable through a XML settings file.
Linear sampling :
Non-interactive fullscreen |
Linear sampling :
Interactive in window mode |
Nearest neighbor sampling :
Interactive in window mode |
Cloud and Landscape Generator
Building my base of reusable code, I spent the last few days implementing, tweaking and making examples of a fractal based clound/landscape generator.
Since the Flash 10 penetration rate will need some time to get close to 100%, it's implemented for Flash 9. Everything is generated in code, so it would be perfect for projects with size limitations or when requiring to generate content dynamically.
Pixel Bender test drive
Flash 10 is out, and delivers a host of new cool features. One in particular attracted my attention: Pixel Benders! It's time to make a minimalistic example and see how it all works.
It's just a simple test that combines the distances from the current pixel to 9 points that I move around using sin/cos in Flash. The Pixel Bender language v1.0 does not support loops, so they need to be unrolled unfortunatly.
There has been lots of confusion about the promised GPU acceleration in Flash Player 10. Tinic Uro ( http://kaourantin.net ) which seems to be part of the Adobe Flash development team, stated quite clearly in his May 20th blog post that GPU acceleration would not be enabled for Pixel Benders inside the Flash player, but given that his blog post was written half a year before release, and the Pixel Bender language is based on GLSL I had to give it a try and see for myself. So I exported the SWF with the wmode set to GPU in addition to the CPU ("no hardware acceleration") version.
Try the wmode="gpu" version:
GPU
Clearly Pixel Benders are not executed on the GPU inside Flash 10 player, but still delivers good performance as the JIT compiler produces a lot more efficient code than AS3.0, SIMD execution units on the CPU are utilized, and it is multithreaded by nature so it executes across all CPU cores. Testing the performance on a few different systems gives the following results (results from the Pixel Bender toolkit that runs the kernel on the GPU are also included):
- Ultra low-end laptop: Celeron M 370 (single core Pentium M @1.5GHz) | 10 FPS | (100% CPU usage) Flash Player 10
- Core 2 E6600 (dual core @ 2.4GHz) | 50 FPS | (90% CPU usage) Flash Player 10
- Core 2 Q6600 (quad core @ 2.4GHz) | 90 FPS | (80% CPU usage) Flash Player 10
- Geforce 7600GT | ~250 FPS | Pixel Bender Toolkit
- Geforce 8800GTS | ~1200 FPS | Pixel Bender Toolkit
About 1200 FPS on a Geforce 8800GTS. Wow! What a shame this performance isn't available through Flash. The good news is Pixel Bender code is scaling really well across cores..
On a side note; Intel will release a "many core" chip called Larrabee, but it would probably only be accessable through simulated DirectX, OpenGL or a native API. See the August 08 paper. Realtime raytracing's getting closer! :-)
Water Effect
Here's a water effect I made some time back.
| Flash 9 version : | Flash 10 version : |
|
|
|
The only difference between the versions is I'm using typed arrays (Vector) in the Flash 10 version, which gives a nice performance boost.
It would run smoothly at higher resolutions if implemented as a Pixel Bender kernel, but I'm saving that for another day. :-)


