TubePilot. December 3, 2010 at 1:18 pm
Procedurally generated tubes and tunnels are one of the classic effects known from the Demoscene. It´s like every brilliant demo simply deserves a cam-flight through an infinite tunnel or the like. For example, ‘You should‘ from Haujobb (a demo group) uses a very elegant flight through a tunnel composed of cubes, or better still, ‘Sult‘ by Loonies (guess what…also a demo group) , which puts forward some very stunning tunnel creations!
So even when it comes to Flash10 and its actual non-hardware accelerated status there are tons of techniques to begin the tunneling. But lets start a bit more basic and use an oldschool technique to build a very retro styled tunnel. The trick in the example up next is to precalculate all distances and angles that we need and store that informations in 2 Lookup tables first, so that we get rid of expensive function calls like ‘Math.sqrt’ or ‘Math.sin’ which are quite expensive when it comes to performance. If we follow that simple rule we easily can setup and handle a very large (800×600) oldschool tunnel:
All right. Perhaps I shouldn´t leave it like that because this approach is way too ancient for sure! And inspired by all those great demos I got an idea for a little 3D camflight too - working title: ‘Tube Pilot’. The underlying idea was to dive into the inside of an 3D cylinder which is textured with a highly glossy/metallic surface. Well, creating texture-materials and behaviours that imitate specular surface conditions like reflections, glossiness, vignettes and light falloffs isn´t that easy to manage with Flash only because you need to calculate lots of pixels at the same time. So I decided to write some Pixel Bender based shaders which are able to process those necessary pixel manipulations a lot more faster compared to a pure Actionscript solution. Took me longer as I expected to write all those little filters, but by now I feel quite comfortable with the results (you can launch the specular texture creation as extract if you feel like).
Finally the fun part: Finding some interesting settings to rotate, zoom and move the camera on its way through the tube. And hell yeah… the actual state of affairs looks like this:
p.s.: The last six month I spend lots of my time digging deep into some Molehills to prepare demos and stuff for my new upcoming talk called ‘Realtime (hard)‘ - which I´m gonna give for the first time at upcoming FITC Amsterdam next year. For that reason I´d like to invite you all to come and visit upcoming Flash Platform Come Together in Cologne (11.12.2010, SAE Institute). It´s a COSTLESS meeting! There I´ll do my actual talk ‘Triangle Affairs’ for the last time and, for good measure, show a little sneak preview (a.k.a a demo) of what my latest Molehill generated stuff looks like and what you probably can expect from me next year…
Oops, did I mention that the all smart David Lenaerts (derschmale.com) will give a talk there too?
Better be there!





