Custom Formula Editor for Visions of Chaos

One of the features I have wanted to implement since the earliest versions of Visions of Chaos has been a formula editor and compiler so users can experiment with their own fractal formulas. This has also been requested many times from various users over the years. Now it is finally possible.

Rather than write my own formula parser and compiler I am using the OpenGL Shading Language. GLSL gvies faster results than any compiler I could code by hand and has an existing well documented syntax. The editor is a full color syntax editor with error highlighting.

Visions of Chaos Formula Compiler

As long as your graphics card GPU and drivers support OpenGL v4 and above you are good to go. Make sure that you have your video card drivers up to date. Old drivers can lead to poor performance and/or lack of support for new OpenGL features. In the past I have had outdated drivers produce corrupted display outputs and even hang the PC running GLSL shader code. Always make sure your video drivers are up to date.

For an HD image (1920×1080 resolution) a Mandelbrot fractal zoomed in at 19,000,000,000 x magnification took 36 seconds on CPU (Intel i7-4770) vs 6 seconds on GPU (GTX 750 Ti). A 4K Mandelbrot image (3840×2160 resolution) at 12,000,000,000 x magnification took 2 minutes and 3 seconds on CPU (Intel i7-6800) and 2.5 seconds on GPU (GTX 1080). The ability to quickly render 8K res images for dual monitor 4K displays in seconds is really nice. Zooming into a Mandelbrot with minimal delays for image redraws really increases the fluidity of exploration.

So far I have included the following fractal formulas with the new Visions of Chaos. All of these sample images can be clicked to open full 4K resolution images.

Buffalo Fractal Power 2

Buffalo Fractal

Buffalo Fractal Power 3

Buffalo Fractal

Buffalo Fractal Power 4

Buffalo Fractal

Buffalo Fractal Power 5

Buffalo Fractal

Burning Ship Fractal Power 2

Burning Ship Fractal

Burning Ship Fractal

Burning Ship Fractal Power 3

Burning Ship Fractal

Burning Ship Fractal

Burning Ship Fractal Power 4

Burning Ship Fractal

Burning Ship Fractal

Burning Ship Fractal Power 5

Burning Ship Fractal

Burning Ship Fractal

Celtic Buffalo Fractal Power 4 Mandelbar

Buffalo Fractal

Celtic Buffalo Fractal Power 5 Mandelbar

Buffalo Fractal

Celtic Burning Ship Fractal Power 4

Burning Ship Fractal

Celtic Mandelbar Fractal Power 2

Celtic Mandelbar Fractal

Celtic Mandelbrot Fractal Power 2

Celtic Mandelbrot Fractal

Celtic Heart Mandelbrot Fractal Power 2

Celtic Heart Mandelbrot Fractal

Heart Mandelbrot Fractal Power 2

Heart Mandelbrot Fractal

Lyapunov Fractals

Lyapunov Fractal

Lyapunov Fractal

Lyapunov Fractal

Lyapunov Fractal

Magnetic Pendulum

Magnetic Pendulum

Mandelbar (Tricorn) Fractal Power 2

Mandelbar Fractal

Mandelbar Fractal Power 3

Mandelbar Fractal

Mandelbar Fractal Power 3 Diagonal

Mandelbar Fractal

Mandelbar Fractal Power 4

Mandelbar Fractal

Mandelbar Fractal Power 5 Horizontal

Mandelbar Fractal

Mandelbar Fractal Power 5 Vertical

Mandelbar Fractal

Mandelbrot Fractal Power 2

Mandelbrot Fractal

Mandelbrot Fractal

Mandelbrot Fractal Power 3

Mandelbrot Fractal

Mandelbrot Fractal

Mandelbrot Fractal Power 4

Mandelbrot Fractal

Mandelbrot Fractal

Mandelbrot Fractal Power 5

Mandelbrot Fractal

Mandelbrot Fractal

Partial Buffalo Fractal Power 3 Imaginary

Partial Buffalo Fractal

Partial Buffalo Fractal Power 3 Real Celtic

Partial Buffalo Fractal

Partial Buffalo Fractal Power 4 Imaginary

Partial Buffalo Fractal

Partial Burning Ship Fractal Power 3 Imageinary

Partial Burning Ship Fractal

Partial Burning Ship Fractal Power 3 Real

Partial Burning Ship Fractal

Partial Burning Ship Fractal Power 4 Imageinary

Partial Burning Ship Fractal

Partial Burning Ship Fractal Power 4 Real

Partial Burning Ship Fractal

Partial Burning Ship Fractal Power 5

Partial Burning Ship Fractal

Partial Burning Ship Fractal Power 5 Mandelbar

Partial Burning Ship Fractal

Partial Celtic Buffalo Fractal Power 4 Real

Partial Celtic Buffalo Fractal

Partial Celtic Buffalo Fractal Power 5

Partial Celtic Buffalo Fractal

Partial Celtic Burning Ship Fractal Power 4 Imaginary

Partial Celtic Burning Ship Fractal

Partial Celtic Burning Ship Fractal Power 4 Real

Partial Celtic Burning Ship Fractal

Partial Celtic Burning Ship Fractal Power 4 Real Mandelbar

Partial Celtic Burning Ship Fractal

Perpendicular Buffalo Fractal Power 2

Perpendicular Buffalo Fractal

Perpendicular Burning Ship Fractal Power 2

Perpendicular Burning Ship Fractal

Perpendicular Celtic Mandelbar Fractal Power 2

Perpendicular Celtic Mandelbar Fractal

Perpendicular Mandelbrot Fractal Power 2

Perpendicular Mandelbrot Fractal

Quasi Burning Ship Fractal Power 3

Quasi Burning Ship Fractal

Quasi Burning Ship Fractal Power 5 Hybrid

Quasi Burning Ship Fractal

Quasi Celtic Heart Mandelbrot Fractal Power 4 Real

Quasi Celtic Heart Mandelbrot Fractal

Quasi Celtic Heart Mandelbrot Fractal Power 4 False

Quasi Celtic Heart Mandelbrot Fractal

Quasi Celtic Perpendicular Mandelbrot Fractal Power 4 False

Quasi Celtic Perpendicular Mandelbrot Fractal

Quasi Celtic Perpendicular Mandelbrot Fractal Power 4 Real

Quasi Celtic Heart Mandelbrot Fractal

Quasi Heart Mandelbrot Fractal Power 3

Quasi Heart Mandelbrot Fractal

Quasi Heart Mandelbrot Fractal Power 4 Real

Quasi Heart Mandelbrot Fractal

Quasi Heart Mandelbrot Fractal Power 4 False

Quasi Heart Mandelbrot Fractal

Quasi Heart Mandelbrot Fractal Power 5

Quasi Heart Mandelbrot Fractal

Quasi Perpendicular Burning Ship Fractal Power 3

Quasi Perpendicular Burning Ship Fractal

Quasi Perpendicular Burning Ship Fractal Power 4 Real

Quasi Perpendicular Burning Ship Fractal

Quasi Perpendicular Celtic Heart Mandelbrot Fractal Power 4 Imaginary

Quasi Perpendicular Celtic Heart Mandelbrot Fractal

Quasi Perpendicular Heart Mandelbrot Fractal Power 4 Imaginary

Quasi Perpendicular Mandelbrot Fractal

Quasi Perpendicular Mandelbrot Fractal Power 4 False

Quasi Perpendicular Mandelbrot Fractal

Quasi Perpendicular Mandelbrot Fractal Power 5

Quasi Perpendicular Mandelbrot Fractal

A lot of the above formulas came from these summaries stardust4ever created.

Fractal Formulas

Fractal Formulas

Fractal Formulas

Fractal Formulas

All of these new custom fractals are fully zoomable to the limit of double precision floating point variables (around 1,000,000,000,000 magnification in Visions of Chaos). The formula compiler is fully supported for movie scripts so you can make your own movies zooming into these new fractals.

This next sample movie is 4K resolution at 60 fps. Each pixel was supersampled as the average of 4 subpixels. This took only a few hours to render. The resulting Xvid AVI was 30 GB before uploading to YouTube.

So, if you have been waiting to program your own fractal formulas in Visions of Chaos you now can. I look forward to seeing the custom fractal formulas Visions of Chaos users create. If you do not understand the OpenGL shading language you can still have fun with all the default sample fractal formulas above without doing any coding.

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.