Menger sponge, wtf? - you might say, so let us primary and short clarify what is meant here. In mathematics, a Menger sponge is a fractal curve and it was first described by Karl Menger while exploring the concept of topological dimension.It is a universal curve, in that it has topological dimension one, and in any other compact metric space of topological dimension 1 is homeomorphic to some subset of it (Reference: Wikipedia).
Hmmm… fine, and where do we go from here? There are tons of code conversions out there showing Menger sponge´s in all kind of variations, but one of my favourite realizations called ‘Spongy‘ from TBC (a demo group) was released in 2009 during ‘Function 2009‘. What´s done here is that they are ray tracing a Menger sponge from the inside.
‘WOOOT’ - didn´t I just wrote about ‘Raytracer‘ and ray tracing lastly? ;) Btw., never seen demos done by TBC? You really should take a look at TBC demos like ‘untraceable’ or ‘tracie‘ for your inspiration.
Actually, having no hardware acceleration in Flash ray tracing IFS Fractals isn´t a good idea at all. But after I came across this little snippet called ‘JSpongy‘ (by p01) which is an HTML5 adaption of TBC´s Spongy my interest awoke. The task: Let´s bring it to Alchemy and this is where I came up with at the end of the day: And - how shall I put it? Ray tracing a Menger sponge (scaled by factor 2) ~21fps isn´t such a bad thing, right? (thanks to Alchemy)
And referring to all those great ideas from the Demoscene it´s only fair to maintain their course - in other words, if they wouldn´t release the resources of all their great coding tricks and hacks we would not be where we are today! So feel free to catch the sources and make the best of it.
Additionally three more brilliant articles about ray tracing I forgot to mention last time:
Ray tracing is one of many techniques to render images with a computer by tracing the path of light through pixels in an image plane and simulating the effects of its encounters with virtual objects (Reference: Wikipedia). Ray tracing has been used in production environment for off-line rendering for a few decades now, but in times of increasing computing speeds and due to the high quality of the visual effects it achieves, ray tracing is becoming more and more applicable for interactive and animated rendering. Yeah, real time ray tracing! Sounds good in the abstract - but of course mostly fails when it comes to Flash which has no hardware acceleration at all…
Ok, there have been attempts building real time raytracers with Flash in the past and probably Strille´s raytracer was worth mentioning in recent years, but a few days ago I took notice of Simo´s fantastic approach of real time ray tracing. In that case the entire calculations are done with Pixel Bender and Flash just draws the final result. Not forgetting Ralph´s raytracer at this moment, but his example doesn´t show all of its power by far because if you ever visited one of Ralphs sessions you´ll see that his raytracer took giant strides from then on!
Seeing all this great approaches recently I resolve upon writing my own little raytracer by not using Pixel Bender but Alchemy as my weapon of choice. I decided to stay close to Simo´s setup so we finally can compare framerates aso. So, after a few eves and nights of tweakings and optimizations I got my raytracer running ~32fps, so here we go…
It´s still a very basic raytracer, so no refractions, Fresnel, noisy bump or other procedural texture mapping, but it runs very smooth and that´s a good beginning so far. Lastly, believing in the Flash community and that open source helps on developing all that great stuff we can use with Flash today, feel free to catch the sources.
Maybe you saw my FITC or FFK10 talks - then you know I played a lot with Flash & Arduino Board interactions recently. Making Flash listening to an extern Arduino Board input is easier as you might have guessed. I´m not asking you to shoot on your Arduino Board with a water gun as I use to do in my sessions (as you can see here), although using water to produce pressure on an force sensor really is the fun part, but if you want to get a read, then the likeable people at Create or die just released my little article about connecting an Arduino Board and Flash.
Afterwards you very probably will manage to use an extern Arduino Boards force sensor to cause the same impacts you now can generate by simply clicking with your mouse on the plane (click ‘Grid on/off’ to show wireframe).
Whilst working on ‘SurfaceX v0.2‘ there is every once a while enough spare time to script some different effects alongside. Therefore… surprise surprise: Boulders is one of those spin-offs I came across the last days. To simplify this experiment - it´s all about constantly shifting cubes that react on sound being displaced by adding some filters on top.
Short hints:
Turn on your speakers!
You´ve to wait until the sound has loaded
Afterwards the system moves into gear - wait till the upcoming spoken decor has finished (~10 secs)
Displacing starts and now you can press- & hold down left mouse button to rotate the boulders
Boulders
Well, developing ‘SurfaceX v0.2‘ over a long period now and digging deep into C-Code & Alchemy it´s so important for me having those distractions from time to time to get some variety. Enjoy!
My last weeks were strongly characterized by scripting ideas in C that might make new things possible in Flash. By doing so I´m reading a lot of research-docs and such and among lots other things I came across this little piece of code called the Lattice Effect. “Phew,” quite a lot of loops-, iterations-, and calculations in there so it might not work in Flash only, but I thought I should give it a try by using Alchemy. And look mom - it´s running!
Well, in my case the Lattice Effect is completely calculated in C (which isn´t the most performant way at all) and Flash is not used for more than displaying the ongoing results… but hey, calculating ~33600 pixels from the scratch in realtime building this lattice is pretty worth doing this way. For now you can switch the ‘display-mode’ between fisheye- and normal lens by simply clicking on the stage.
And due to the fact that this is just an actual byproduct from what I´m working on, I´m pretty looking forward optimizing and speeding things up. Want to optimize and speed up this effect yourself? Download the full sourcecode here.
After a period of having good times with lots of great people on several conferences (recently FFK10 has just been over) it´s time to concentrate on doing new experiments and ideas.
Recently I was playing with types of application for perlinNoise. One thing that truly is lame when it comes to Flash is the fact that perlinNoise still is a BitmapData function only. Therefore, remedy comes quite a long time ago (2007) in the form of Ron Valstar and in an even more optimized perlin noise version by Mario Klingemann. Fair enough so far! But using this optimized version for some random sequence generated values I could use for calculations let me reach an impasse (having ~4 fps processing a 150×150 squared bitmap using the static noise function as part for manipulating pixels).
What next? One solution is Nicolas Cannasse´s haXe version of optimized perlin noise which than was slightly extended by Einar Öberg but both portings unfortunately didn´t offer that little nice static noise function that Ron and Mario´s class provided. So I quickly implemented this noise function in there.
Hereafter I could start playing with haXe driven noise plus using Virtual Memory as an pleasant side effect… which leads me to this little result called Perlin Flow (use your mouse to affect the streaming):
Want to be in progress? Feel free to download the sources and do you worst! Well, like I said: For now conference days are over - so let´s start playing and experimenting again… ;)
Again at last, and due to the fact upcoming FFK10 conference waits right in front of the door, I finally got some time to give some blobs a new coat of whitewash (naturally it needs my vacation to do so… that figures!)
And indeed there´s nothing better than sitting in front of the chimney at your Scottish vacation Highland-lodge, generating some Space Goo. And as a result we achieve yet again, some nice little mass mindless bubbling around into time and space.
And let me tell you, this little space soup reacts quite well to music too, so you may wait whilst the track is loaded and maybe cheat some time simply rotate those chubby fellows in space…
Phew! Nearly 3 month without a single blogpost… time to change this right now. But the last 3 month have been very intense concerning to prepare experiments and code-snippets for my this years conference session topic called ‘Dreiecksbeziehungen’: Past FITC Amsterdam 2010 was the debut for it, and FFK10 will be the next time. So, being back home from a brilliant 4 days trip to Amsterdam I decided to write down my impressions. Well, and the kind guys from Create or die just released my FITC Amsterdam review.
Lastly I really have to say that it was such an amazing time andI´m really looking forward to FFK10 in Cologne. Hope to see you guys back in Cologne then!
Last weekend I got a mail from Marc that I´m in once again to give a talk at next years FFK10 conference. What a brilliant Christmas surprise! And… new year new session. ‘Dreiecksbeziehungen’ (a.k.a Return of the blobs - RELOADED) will cover a lot of new unpublished experiments like isosurfaces, blob-meshes, 3D metaballs and beyond that a lot of realtime fluid simulations via Flash and an Arduino Board interactions.
Anyway I´m totally stoked!
Btw. Christmas is coming up, right? So here are my little cellular automata season´s greetings…