Karl Sims

If you are a nerd then you most likely have heard of Karl Sims. If you haven’t heard of him give his page a browse as there is some good stuff there.

I have admired and respected him since his work in Genetic Images back in 1993 that inspired all three of my attempts at Genetic Art so far. I still have a few more ideas on new Genetic Art methods to experiment with and share when I get some spare time.

I noticed his latest work as I was browsing Reaction Diffusion videos on YouTube. Yes, if you know what to look for there are videos on YouTube better than this one that was featured on their homepage and has millions of hits so far. I must be getting old(er)… “What is wrong with kids these days”!?

Check these two RD samples Karl put up on YouTube.

The most impressive aspect of those is the shading that gives them the 3D look. (Aussies can confirm the almost exact reflectance of the second example to Vegemite). Remember that the output of these Reaction Diffusion equations is strictly 2D. The bulging 3D look is based on calculating the slope between neighbouring pixels. Or at least that is how I do it in Visions Of Chaos, but Karl’s versions seem so much more 3Dish than mine. See his images here that are awesome.

As always he inspires me (and I am sure many others) to do better.

Jason.

GLSL support added to Visions Of Chaos

What is GLSL?

The OpenGL Shading Language (or GLSL) allows you to write programs that run on the GPU rather than the CPU. GPUs these days can have thousands of “cores” so code running on the GPU can be magnitudes faster than running on the CPU. Fractal images are ideal for GLSL because in most fractals each pixel can be calculated independantly of the others so it is ideal for running in parallel.

For example the following pic is a raytraced example of five touching reflective spheres. The CPU version of this code took minutes to render. The GPU shader code takes 65 milliseconds on a not so super Nvidia card.

GLSL Wada Basins

GLSL in Visions Of Chaos

After having been on my to do list for years, I have finally gotten around to adding GLSL support into Visions Of Chaos.

Mandelbulb

The main delay in releasing this new version was converting all the Mandelbulb mode related functions into the GLSL language. Not too difficult, but very tedious. The speed increase for the Mandelbulb mode is amazing.

The output quality is mostly identical to the non-GLSL software mode rendering, so all your existing sample Mandelbulb files will usually continue to load and display as normal. GLSL supports single precision floating point numbers so deep zooms into the bulb will be less defined, but for the majority of renders you won’t notice a difference.

For example, here is a relatively deep zoom into a Mandelbulb using the CPU double precision

Mandelbulb

and here is the same with single point GPU/GLSL single precision

Mandelbulb

Single precision GLSL has the approximate floating point limit/resolution of 0.000001 which Visions Of Chaos now clamps the epsilon value to if it ever gets beyond it and you are using the GLSL calculations. No doubt NVidia and ATI will get the double precision working in future models, but for the time being if you want to do deep zooms into Mandelbulbs and related fractals you will hit the precision wall.

Mandelbox

I will be converting more of the slower modes over to GLSL in the future. Mandelbulbs had to be first as that was the most complex and hence slowest mode in Visions Of Chaos.

Mandelbulb

These are some speed increase results after testing the new Mandelbulb shader code on some different PCs (ranked from worse to best);

NVidia Geforce 9500 GT – 7 to 17 times faster.

NVidia Geforce 8500 GT – 15 to 25 times faster.

NVidia Geforce 8800 GT – 102 to 154 times faster.

NVidia Geforce GTX 570 – 140 to 230 times faster.

Make sure you have the latest drivers for your video card. Updating to the latest version can help improve perfomance.

Mandelbulb

I also included a bunch of sample shaders from the GLSL Sandbox to show off what these rather simple shaders can do on a decent (or even not so decent) graphics card.

Mandelbulb

On a side note I have the above image printed out and stuck on the wall at work in my office as it is one of my more favourite and iconic Mandelbulb images. It freaked this one guy out. “Doesn’t that give you the creeps that picture?!”. I tried to explain what it actually was but all he could relate it to was Alien. “Well it is actually based on a relatively simple mathematical formula that makes all those complex self similar patterns”. His eyes glazed over before I dared mention complex numbers and their three dimensional triplex variants. “Nah man, too bizarre for me!”.

Jason.

Wada Basins Part 2

I have been interested in Wada Basins for some time now. Wada Basins are the fractal like patterns that occur between touching reflective spheres. I finally got around to start adding support for GLSL into Visions Of Chaos. GLSL is the OpenGL Shading Language that allows you to use your graphics card processor (GPU) to do calculations that are magnitudes times faster than your CPU will ever be able to accomplish.

Here is a sample zoom sequence into a wada basin rendered using path tracing. Using the path tracing approach leads to global illumination with colors bleeding into nearby surfaces and soft shadows. If I was to even attempt to render these sort of images on the CPU alone this post would be months away, but harnessing the power of the GPU allowed these snapshots to be done in relatively no time at all.

Wada Basins

Wada Basins

Wada Basins

Wada Basins

Wada Basins

Wada Basins

The new version of Visions Of Chaos supporting GLSL will be out soon “when it’s ready”. I have meant to release it for a while now, but I keep adding new features and making changes.

Jason.

Cube Division Fractals

Take a regular cube. It can be broken up into eight smaller cubes. Remove one or more of those eight cubes. Repeat the removal process for each of the remaining smaller cubes. Repeat again as many times as you like.

This gives you 256 possible unique fractal cube structures. So you take a “rule number”, convert it to a binary string and then use the bninary string to determine which of the eight subcubes are removed.

Here is an example of rule number 132 after 2, 3, 4 and 5 iterations.

Cube Division Fractal

Cube Division Fractal

Cube Division Fractal

Cube Division Fractal

and here is a movie of the level 5 rule 132 fractal rotating.



You can also apply the same principal, but based on random numbers. Each set of subcubes has a 1 in 8 chance of being removed. The rule number then becomes the pseudo random number generator seed value.

Here is an example movie of random rule 1155 rotating.



I have included these new fractal cubes in the latest version of Visions Of Chaos.

Jason.

Video Feedback Simulation Take 2

I have been interested in video feedback and simulating video feedback on and off for years.

I recently stumbled across this amazing 4k demo. The exe file that generates the following movie in realtime is less than 4096 bytes in size!!

Awesome result. The makers kindly wrote up an explanation page that describes how the video feedback like effects were created.

So based on those principals I used a bunch of (slower) non shader software based image processing routines and got the following results.

These are much faster to generate than my previous experiments with simulating video feeback.

Generation Steps

Initialisation
1. Create 2 bitmaps for a main layer and a temp layer
2. Fill them both with random static

Main loop
1. Each pixel RGB in the main bitmap is converted to HSL. The HSL values are used as an angle and a distance. The angle and distance then points to a new pixel location on the temp bitmap. The main bitmap pixel is the colored using the temp bitmap pixel color.
2. Sharpen the main bitmap.
3. Blur the main bitmap.
4. Display the main bitmap.
5. Blend the main bitmap with the temp bitmap.
6. Rotate the temp bitmap.
7. Histogram equalise the temp bitmap. This is similar to how Photoshop does auto-contrast.
8. Zoom the temp bitmap.

Here is a full 1080p HD sample with 10 minutes of footage showing the types of results this new algorithm creates.

If you are not a coder and want to play with this download Visions Of Chaos.

Jason.