I made the Mandelbrot fractal in Blender

using nothing but the node system. [1]

If you like, download and play with it. [2]

Click on any picture to see a full-sized version.

The fractal exists in the complex plane. [3]

A 2D image, with Red and Green values

for Real and Imaginary numbers, suffices.

This equation is applied to each point:

where C is the point, and ZZ _{n+1}= Z_{n}^{2}+ C

With real X and Y values,

the equivalent equations are:

X_{n+1}= X_{n}^{2}- Y_{n}^{2}+ X_{0}

Y_{n+1}= 2 * X_{n}* Y_{n}+ Y_{0}

If a C's Z_{n} is farther than 2 from 0+0*i*,

then its later Zs are all far from 0+0*i*,

and that C is not a part of the fractal.

Cs that remain have blue added.

Here are all of the nodes

to calculate one iteration:

Nodes are grouped together

for organization and density.

In the end, each shade of blue

is turned into a different color, [4]

and the center is turned to black.

The images is sharpened

by calculating repeatedly.

This gives a pretty result.

With more iterations,

the color bands get

harder to tell apart.

Multiplying the normalized steps

and moduloing them back to 0 to 1

makes the colors easier to distinguish.

After figuring this much out,

I found out regerogarc did, too.

I am working on better versions

and neat tricks for this project.

I will post updates when they're done.

[1]
Blender can be programmed with Python.

Using that would have made this too easy.

Instead, I used (perhaps abused) Blender's

node-based texture and image compositor systems.

These are meant to be used

to modify the surface of 3D objects

or to filter the final rendered images.

Instead, I'm using them to draw mathy

pictures from scratch, with no 3D models.

Because this is an *unusual* way to use Blender,

this project is slow and uses a lot of memory.

However, I thought it was a hack worth sharing.

[2]
I made this file with Blender
2.79b.

It should work in the
latest version, too.

[3]
The math for the Mandelbrot fractal

uses numbers called "complex numbers".

If you want to learn complex arithmetic,

you can learn about it on
Khan Academy.

[4]
The "normalize" node always works, but annoyingly

makes the progress bar show 0% until the frame is done.

Replacing it with a "divide" by the number of iterations

restores the progress bar, but needs to be edited whenever

the number of iterations is changed. (Or add a script.)