Remixing Distance Estimation Fractals

Last year I got fairly obsessed with distance estimation (DE) fractals. Recently a few developments in that field have rekindled my interest in the whole phenomenon.

Most of the people playing around with the Mandelbulb and it’s variants back in early 2010 were either mathematicians or graphics programmers, and while there were some technically impressive images and movies, they mostly weren’t that well composed in an artistic sense.

More recently the tools for creating these fractals have become popular amongst artists in on-line communities and some really amazing work is being produced. MandelBulb 3D seems to have become the most popular piece of software used to compose fractal images and movies.

Perhaps the single best feature of this program is the ability to shares the settings of your images by copy pasting a twitter-eque short string of hieroglyphics to other people online. Often people attach these settings as a comment on their image, so other people can reproduce these works or ‘remix’ them for their own creations. I’m particularly found of pieces by Hal Tenny like this. His pictures are inspired by a earlier image named ‘Spudsville‘ created by lenord that included the parameters used in the image, allowing spin off works to happen.

I’ve been working away on a new fractal explorer application of my own. I’ve experimented with various optimizations to the conventional GPU ray casting techniques and I think I’m making some progress.

These images are of the fairly new Kaleidoscopic IFS fractal published by Knighty on Fractal Forums composed with the application I’m working on:


    

Show Your True Colours

This last week saw the release of fairly significant update to Gource – replacing the out dated, 3DFX-era rendering code, with something a bit more modern, utilizing more recent OpenGL features like GLSL pixel shaders and VBOs.

A lot of the improvements are under the hood, but the first thing you’ll probably notice is the elimination of banding artifacts in Bloom, the illuminated fog Gource places around directories. This effect is pretty tough on the ‘colour space’ of so called Truecolor, the maximum colour depth on consumer monitors and display devices, which provides 256 different shades of grey to play with.

When you render a gradient across the screen, there are 3 or 4 times more pixels than there are shades of each colour, producing visible ‘bands’ of the same shade. If multiple gradients like this get blended together, as happens with bloom, you simply run out of ‘in between’ colours and the issue becomes more exaggerated, as seen below (contrast adjusted for emphasis):

        

Those aren’t compression artifacts you’re seeing!

Gource now uses colour diffusion to combat this problem. Instead of sampling the exact gradient of bloom for the distance of a pixel from the centre of a directory, we take a fuzzy sample in that vicinity instead. When zoomed in, you can see the picture is now slightly noisy, but the banding is completely eliminated. Viewed at the intended resolution, you can’t really see the trickery going on – in fact the effect even seems somewhat more natural, a bit closer to how light bouncing off particles of mist would actually behave.

        

The other improvement is speed – everything is now drawn with VBOs, large batches of objects geometry passed to the GPU in as few shipments as possible, eliminating CPU and IO bottle necks. Shadows cast by files and users are now done in a second pass on GPU using the same geometry as used for the lit pass – making them really cheap compared to before when we effectively wore the cost of having to draw the whole scene twice.

Text is now drawn in single pass, including shadows, using some fragment shader magic (take two samples of the font texture, offset by 1-by-1 pixels, blend appropriately). Given the ridiculous amount of file, user and directory names Gource draws at once with some projects (Linux Kernel Git import commit, I’m looking at you), doing half as much work there makes a big difference.

New Zealand Open Source Awards

I discovered today that Gource is a finalist in the Contributor category for the NZOSA awards. Exciting stuff! A full list of nominations is here.

I’m currently taking a working holiday to make some progress on a short film presentation of Gource for the Onward!.

Update: here’s the video presented at Onward!:

Craig Anslow presented the video on my behalf (thanks again Craig!), and we did a short Q/A over Skype afterwards. The music in the video is Aksjomat przemijania (Axiom of going by) by Dieter Werner. I suggest checking out his other work!

Life is Strange

Here is my tribute to a fascinating new fractal I talked about in an earlier post, the Mandelbulb.

(Youtube: http://www.youtube.com/watch?v=W3x4uJJqs_w)

The music in the video is ‘Life is strange (trance remix)’ by darkangell.

I recorded the scenes using my work in progress Mandelbulb Viewer/Fly through builder application (which is on my github, if you’re curious). While working on this video, I added a few new effects like glow and fog, and also a periodic ‘beat’ to synchronize some effects to music.

As I mentioned before, the viewer is based on a fragment shader implementation of the Mandelbulb fractal by Tom Beddard. His blog has a lot of nice renderings also.

Ray-tracing is a tedious process, who knew? Normally capturing video in real or close to real time is something that I just take for granted. For this video, capturing a 20 second fly over (about enough for one shot in the final video) took around 30 minutes to render.

The rendering lag became slightly more manageable after implemented recording/config file support in the viewer, so I could go back and tweak the settings of a previous recordings that didn’t quite make the cut, and try again. I also got into the habit of testing the recording at low quality at 640×360 (1/4 720p, same aspect ratio), to get a feel for how it would look in motion at the right frame rate.

Vimeo: http://vimeo.com/10740680

Update: I wasn’t very happy with the contrast levels of the original video, so I decided to re-upload it and ended up re-editing it. Feels a lot more coherent now.

Update II: ‘Life is Strange’ received second place is the Fractalforums.com Spring 2010 Competition. You can see the full set of video entries here.

New Logstalgia Released

I’ve just released a new version of Logstalgia, my website access log visualization that looks a bit like Pong if only it had been created by Jeff Minter. Logstalgia is also referred to as ApachePong (referring to both the Apache Web Server and Pong) which is a much better name, but also covered by multiple trademarks.

Here’s a new video to go with it.

The song is ‘Depart’ by Tekno Eddy, which I found on ccmixter.org, which is a good place to find Creative Commons music that people actually want you to use (with attribution) in your Youtube videos.

The new version of Logstalgia adds a bunch of features back-ported from Gource, like being able to seek to a point in the log file, and the much needed PPM output support for making videos that was probably the biggest feature missing originally.

Go get it!

Linux.Conf.Au 2010

Last week I attended Linux Conf Australia, the annual conference for all things Open Source down under, this year held in Wellington, New Zealand, the city where I live.

I was very lucky to get the opportunity to organize some of the displays at the conference. An application developed for the conference displayed information such as timetables for talks, social events and photos taken by the attendees. It also showed off my latest visualization, Gource, displaying bits of random development from projects like the Linux Kernel.

Here’s a video of the displays I made for the conference.

The Life Flight Trust, the emergency helicopter rescue service for the Wellington area, was the featured charity of the conference. Attendees were encouraged to make donations, with the reward that the largest donor would be able to participate in a helicopter winching exercise. I was asked if I could come up with a way to display the donations, and ended up adapting a live graph prototype we’d developed at work (inspired by ‘Stack’ from Digg Labs).

We displayed the live donation feed during the Pengion Dinner, a dinner for professional delegates on the last day of the conference. By the end of the evening, LCA delegates had raised more than $30,000 for the Life Flight Trust!

Helping out with the conference was a really cool experience and totally worth all the time I invested. Be sure to check videos of the talks from LCA which should start appearing on their website tentatively.

Strange Alien Vistas

I’ve been messing around with a new fractal discovered only a few months ago dubbed The Mandelbulb. It has similar interesting visual properties to its forebear, the Mandelbrot fractal, but in three dimensions, which hadn’t been achieved until now.

Here are a few non-typical renderings of the Mandelbulb taken very close to the surface that I thought were interesting (click for full size):

I’ve been working on a viewer/explorer program based on Tom Beddard’s implementation of the algorithm. The viewer will let you fly around using the mouse and keyboard, set up flight paths and make recordings (using the same exporter functions as Gource). It’s not quite there yet, but hopefully after Linux Conf I’ll have some time to finish it off and make some videos.

I already have designs on what music I want to use. I’m thinking some Jarre.

Gource in Bloom

My earlier experiment with Bloom (I am tempted to call it Gourceian Blur) has lead to a new effect/feature in Gource.

(Youtube: http://www.youtube.com/watch?v=NjUuAuBcoqs)

The bloom effect is achieved by blending radial gradients with each other additively. You can do a high quality version by drawing a perfect radial gradient with a Shader, but in Gource i’m using a 512×512 texture which looks fine in most circumstances.

Don’t Negate the Premise

Gource is a visualization for software projects: or is it?

My previous visualization, Logstalgia, was for website access logs. It turns out the information in a website access log and a VCS history are actually some what similar:

  • they both track users, sort of (an ip address may or may not identify one user, but often enough they do)
  • they show the users interaction with a hierarchical directory/file path. Sometimes on a website the path may be a directory path with no specific file, but we can treat such cases as the user requesting the ‘index’ file at that path.
  • they store the time the interaction occurred.

So the up shot is you can visualize website access logs with Gource, and it looks a little something like this:

This feature is built into the current release of Gource, so if your website uses the Apache combined access log format, give it a go.

Gource: Software Version Control Visualization

Gource (the name is a play on Source and Gorse) is a new visualization for software projects (and perhaps over things? I’ll try to stay focused here) which I released a couple months ago after spending the best part of this year working on it in my spare time and in between projects at work.

This is the official ‘promo’ video.

Gource is a visualization for the development history of software projects. Normally when software is developed, the incremental changes to the code are stored in a Version Control System (VCS) which remembers all the changes that were made, who made them, and when. Gource takes this history and plays it back it back as an interactive animation.

“Software projects are displayed by Gource as an animated tree with the root directory of the project at its centre. Directories appear as branches with files as leaves. Developers can be seen working on the tree at the times they contributed to the project.”

The scenes generated by Gource are made up of quite a few different elements:

  • a tree of the active directories generated by a force directed layout. This is the main structure that everything else centers around.
  • the connections of the tree are represented by splines, coloured by the contents of the directories they connect to. the mid point of the splines drags slightly behind, emphasizing the direction of the motion and giving the tree an organic feel.
  • files represented by coloured spheres (the colour coming from a hash of the files file extension) which are laid out in a spiral pattern around the center of the directory node the belong to.
  • users who are currently contributing to the project. Floating in near proximity to the files they are modifying, the users fire out beams indicating the kind of change they made to the file (green add, orange modify, red delete).
  • labels appear above the active files, users and directories when the become active, and fade out shortly after. This avoids there being too much clutter of text while letting the end user see the names of the actors involved in the current activity which their eyes are naturally drawn to.
  • finally, a camera dynamically positions itself to capture the entire scene or the part of the scene the user is interested in (a specific user, file, the area of the project where activity is currently occurring or everything).

The animated directory tree works using a very tweaked variation on force directed algorithms. Getting this to behave well in most situations (the layout and scale of software projects can differ wildly) was the most time consuming part of the project. If you look at a other visualizations that try to display data with this technique they tend to look very volatile and jerky or only work in cherry picked or static situations where the structure of the tree is constant.

Gource has best support for Git (the VCS system built to manage Linux), though there are scripts to use it with other VCS as well (currently CVS, SVN and Mercurial).

You can download Gource from the project page here.